File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
"""Module containing the APEL SSM Messenger."""
18
18
19
+ import datetime
19
20
import json
20
21
import typing
21
22
import warnings
@@ -75,7 +76,7 @@ def _push_message_cloud(
75
76
):
76
77
"""Push a compute message, formatted following the CloudRecord."""
77
78
message = f"APEL-cloud-message: v{ self .version_cloud } \n "
78
- aux = "%%\n " .join (entries )
79
+ aux = "\n %%\n " .join (entries )
79
80
message += f"{ aux } \n "
80
81
queue .add (message .encode ("utf-8" ))
81
82
@@ -189,11 +190,14 @@ def push(self, records):
189
190
}
190
191
for record in records :
191
192
if isinstance (record , caso .record .CloudRecord ):
192
- aux = ""
193
+ aux = []
193
194
for k , v in six .iteritems (record .dict (** opts )):
194
195
if v is not None :
195
- aux += f"{ k } : { v } \n "
196
- entries_cloud .append (aux )
196
+ if isinstance (v , datetime .datetime ):
197
+ aux .append (f"{ k } : { int (v .timestamp ())} " )
198
+ else :
199
+ aux .append (f"{ k } : { v } " )
200
+ entries_cloud .append ("\n " .join (aux ))
197
201
elif isinstance (record , caso .record .IPRecord ):
198
202
entries_ip .append (record .json (** opts ))
199
203
elif isinstance (record , caso .record .AcceleratorRecord ):
You can’t perform that action at this time.
0 commit comments