Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3252947
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
cloud-3252947
Commits
9214227a
Commit
9214227a
authored
6 years ago
by
baldwinlouie
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3005205
: Add ability to notify instance owners
parent
82172828
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/cloud_service_providers/aws_cloud/aws_cloud.module
+1
-1
1 addition, 1 deletion
modules/cloud_service_providers/aws_cloud/aws_cloud.module
with
1 addition
and
1 deletion
modules/cloud_service_providers/aws_cloud/aws_cloud.module
+
1
−
1
View file @
9214227a
...
...
@@ -331,7 +331,7 @@ function aws_cloud_get_instances_to_notify() {
$config
=
\Drupal
::
config
(
'aws_cloud.settings'
);
$frequency
=
$config
->
get
(
'aws_cloud_notification_frequency'
);
$instances
=
[];
$results
=
\Drupal
::
database
()
->
query
(
"select id, user_id, instance_id, launch_time from
{
aws_cloud_instance
}
aws_cloud_instance where aws_cloud_instance.instance_state = :state and unix_timestamp(str_to_date(launch_time, '%Y-%m-%dT%T')) < unix_timestamp(date_sub(current_date(), INTERVAL :day DAY))"
,
[
':state'
=>
'running'
,
':day'
=>
$config
->
get
(
'aws_cloud_notification_criteria'
)])
->
fetchAll
();
$results
=
\Drupal
::
database
()
->
query
(
"select id, user_id, instance_id, launch_time from
{
aws_cloud_instance
}
aws_cloud_instance where
aws_cloud_instance.user_id > 0 and
aws_cloud_instance.instance_state = :state and unix_timestamp(str_to_date(launch_time, '%Y-%m-%dT%T')) < unix_timestamp(date_sub(current_date(), INTERVAL :day DAY))"
,
[
':state'
=>
'running'
,
':day'
=>
$config
->
get
(
'aws_cloud_notification_criteria'
)])
->
fetchAll
();
foreach
(
$results
as
$result
)
{
$notified
=
\Drupal
::
state
()
->
get
(
'aws_cloud_instance_last_notified_'
.
$result
->
id
);
$instance
=
Instance
::
load
(
$result
->
id
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment