File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,6 @@ def monitor():
274274 monitorapp = monitorInfo ["MONITOR_APP_NAME" ]
275275 fleetId = monitorInfo ["MONITOR_FLEET_ID" ]
276276 queueId = monitorInfo ["MONITOR_QUEUE_NAME" ]
277- bucketId = monitorInfo ["MONITOR_BUCKET_NAME" ]
278- loggroupId = monitorInfo ["MONITOR_LOG_GROUP_NAME" ]
279- starttime = monitorInfo ["MONITOR_START_TIME" ]
280277
281278 # Step 1: Create job and count messages periodically
282279 queue = JobQueue (name = queueId )
@@ -289,6 +286,17 @@ def monitor():
289286 time .sleep (MONITOR_TIME )
290287
291288 # Step 2: When no messages are pending, stop service
289+
290+ # Reload the monitor info, because for long jobs new fleets may have been started, etc
291+ monitorInfo = loadConfig (sys .argv [2 ])
292+ monitorcluster = monitorInfo ["MONITOR_ECS_CLUSTER" ]
293+ monitorapp = monitorInfo ["MONITOR_APP_NAME" ]
294+ fleetId = monitorInfo ["MONITOR_FLEET_ID" ]
295+ queueId = monitorInfo ["MONITOR_QUEUE_NAME" ]
296+ bucketId = monitorInfo ["MONITOR_BUCKET_NAME" ]
297+ loggroupId = monitorInfo ["MONITOR_LOG_GROUP_NAME" ]
298+ starttime = monitorInfo ["MONITOR_START_TIME" ]
299+
292300 cmd = 'aws ecs update-service --cluster ' + monitorcluster + \
293301 ' --service ' + monitorapp + 'Service' + \
294302 ' --desired-count 0'
You can’t perform that action at this time.
0 commit comments