##// END OF EJS Templates
add 'received' timestamp to DB...
MinRK -
Show More
@@ -1277,6 +1277,8 b' class Client(HasTraits):'
1277
1277
1278 md = self.metadata[msg_id]
1278 md = self.metadata[msg_id]
1279 md.update(self._extract_metadata(header, parent, rcontent))
1279 md.update(self._extract_metadata(header, parent, rcontent))
1280 if rec.get('received'):
1281 md['received'] = rec['received']
1280 md.update(iodict)
1282 md.update(iodict)
1281
1283
1282 if rcontent['status'] == 'ok':
1284 if rcontent['status'] == 'ok':
@@ -63,6 +63,7 b' def empty_record():'
63 'started': None,
63 'started': None,
64 'completed': None,
64 'completed': None,
65 'resubmitted': None,
65 'resubmitted': None,
66 'received': None,
66 'result_header' : None,
67 'result_header' : None,
67 'result_content' : None,
68 'result_content' : None,
68 'result_buffers' : None,
69 'result_buffers' : None,
@@ -88,6 +89,7 b' def init_record(msg):'
88 'started': None,
89 'started': None,
89 'completed': None,
90 'completed': None,
90 'resubmitted': None,
91 'resubmitted': None,
92 'received': None,
91 'result_header' : None,
93 'result_header' : None,
92 'result_content' : None,
94 'result_content' : None,
93 'result_buffers' : None,
95 'result_buffers' : None,
@@ -630,6 +632,7 b' class Hub(SessionFactory):'
630 result = {
632 result = {
631 'result_header' : rheader,
633 'result_header' : rheader,
632 'result_content': msg['content'],
634 'result_content': msg['content'],
635 'received': datetime.now(),
633 'started' : started,
636 'started' : started,
634 'completed' : completed
637 'completed' : completed
635 }
638 }
@@ -732,7 +735,8 b' class Hub(SessionFactory):'
732 'result_content': msg['content'],
735 'result_content': msg['content'],
733 'started' : started,
736 'started' : started,
734 'completed' : completed,
737 'completed' : completed,
735 'engine_uuid': engine_uuid
738 'received' : datetime.now(),
739 'engine_uuid': engine_uuid,
736 }
740 }
737
741
738 result['result_buffers'] = msg['buffers']
742 result['result_buffers'] = msg['buffers']
@@ -1176,11 +1180,12 b' class Hub(SessionFactory):'
1176 def _extract_record(self, rec):
1180 def _extract_record(self, rec):
1177 """decompose a TaskRecord dict into subsection of reply for get_result"""
1181 """decompose a TaskRecord dict into subsection of reply for get_result"""
1178 io_dict = {}
1182 io_dict = {}
1179 for key in 'pyin pyout pyerr stdout stderr'.split():
1183 for key in ('pyin', 'pyout', 'pyerr', 'stdout', 'stderr'):
1180 io_dict[key] = rec[key]
1184 io_dict[key] = rec[key]
1181 content = { 'result_content': rec['result_content'],
1185 content = { 'result_content': rec['result_content'],
1182 'header': rec['header'],
1186 'header': rec['header'],
1183 'result_header' : rec['result_header'],
1187 'result_header' : rec['result_header'],
1188 'received' : rec['received'],
1184 'io' : io_dict,
1189 'io' : io_dict,
1185 }
1190 }
1186 if rec['result_buffers']:
1191 if rec['result_buffers']:
@@ -117,6 +117,7 b' class SQLiteDB(BaseDB):'
117 'started',
117 'started',
118 'completed',
118 'completed',
119 'resubmitted',
119 'resubmitted',
120 'received',
120 'result_header' ,
121 'result_header' ,
121 'result_content' ,
122 'result_content' ,
122 'result_buffers' ,
123 'result_buffers' ,
@@ -138,6 +139,7 b' class SQLiteDB(BaseDB):'
138 'started' : 'timestamp',
139 'started' : 'timestamp',
139 'completed' : 'timestamp',
140 'completed' : 'timestamp',
140 'resubmitted' : 'timestamp',
141 'resubmitted' : 'timestamp',
142 'received' : 'timestamp',
141 'result_header' : 'dict text',
143 'result_header' : 'dict text',
142 'result_content' : 'dict text',
144 'result_content' : 'dict text',
143 'result_buffers' : 'bufs blob',
145 'result_buffers' : 'bufs blob',
@@ -245,6 +247,7 b' class SQLiteDB(BaseDB):'
245 started timestamp,
247 started timestamp,
246 completed timestamp,
248 completed timestamp,
247 resubmitted timestamp,
249 resubmitted timestamp,
250 received timestamp,
248 result_header dict text,
251 result_header dict text,
249 result_content dict text,
252 result_content dict text,
250 result_buffers bufs blob,
253 result_buffers bufs blob,
General Comments 0
You need to be logged in to leave comments. Login now