Skip to content

Commit d2bf589

Browse files
authored
Update cp-worker.py (#86)
1 parent 4c5fd46 commit d2bf589

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

worker/cp-worker.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ def runCellProfiler(message):
107107
message['Metadata']=metadataForCall[:-1]
108108
elif 'output_structure' in message.keys():
109109
if message['output_structure']!='': #support for explicit output structuring
110+
logger.addHandler(watchtowerlogger)
110111
metadataID = message['output_structure']
112+
watchtowerlogger=watchtower.CloudWatchLogHandler(log_group=LOG_GROUP_NAME, stream_name=message['Metadata'],create_log_group=False)
111113
for eachMetadata in message['Metadata'].split(','):
112114
if eachMetadata.split('=')[0] not in metadataID:
113-
watchtowerlogger=watchtower.CloudWatchLogHandler(log_group=LOG_GROUP_NAME, stream_name=message['Metadata'],create_log_group=False)
114-
logger.addHandler(watchtowerlogger)
115115
printandlog('Your specified output structure does not match the Metadata passed',logger)
116116
else:
117117
metadataID = string.replace(metadataID,eachMetadata.split('=')[0],eachMetadata.split('=')[1])
118+
printandlog('metadataID =',metadataID)
118119
else: #backwards compatability with 1.0.0 and/or no desire to structure output
119120
metadataID = '-'.join([x.split('=')[1] for x in message['Metadata'].split(',')]) # Strip equal signs from the metadata
120121
else: #backwards compatability with 1.0.0 and/or no desire to structure output

0 commit comments

Comments
 (0)