88"""
99
1010from telescope .typings import CheckResult
11- from telescope .utils import run_parallel , utcnow
11+ from telescope .utils import run_parallel , utcfromtimestamp , utcnow
1212
1313from .utils import KintoClient
1414
@@ -31,8 +31,18 @@ async def run(
3131 False ,
3232 {
3333 "monitor/changes" : {
34- "source" : source_entries [0 ]["last_modified" ],
35- "target" : target_entries [0 ]["last_modified" ],
34+ "source" : {
35+ "timestamp" : source_entries [0 ]["last_modified" ],
36+ "datetime" : utcfromtimestamp (
37+ source_entries [0 ]["last_modified" ]
38+ ).isoformat (),
39+ },
40+ "target" : {
41+ "timestamp" : target_entries [0 ]["last_modified" ],
42+ "datetime" : utcfromtimestamp (
43+ target_entries [0 ]["last_modified" ]
44+ ).isoformat (),
45+ },
3646 },
3747 },
3848 )
@@ -75,15 +85,21 @@ async def run(
7585
7686 if source_metadata_timestamp != target_metadata_timestamp :
7787 outdated ["{bucket}/{collection}" .format (** entry )] = {
78- "source" : source_metadata_timestamp ,
79- "target" : target_metadata_timestamp ,
88+ "source" : {
89+ "timestamp" : source_metadata_timestamp ,
90+ "datetime" : utcfromtimestamp (source_metadata_timestamp ).isoformat (),
91+ },
92+ "target" : {
93+ "timestamp" : target_metadata_timestamp ,
94+ "datetime" : utcfromtimestamp (target_metadata_timestamp ).isoformat (),
95+ },
8096 }
8197
8298 # Sort entries by source timestamp descending.
8399 outdated = dict (
84100 sorted (
85101 outdated .items (),
86- key = lambda entry : entry [1 ]["source" ],
102+ key = lambda entry : entry [1 ]["source" ][ "timestamp" ] ,
87103 reverse = True ,
88104 )
89105 )
0 commit comments