File tree Expand file tree Collapse file tree
python/fledge/tasks/purge Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 All these statistics are inserted into the log table
3030"""
3131import time
32- import pytz
33- from datetime import datetime , timedelta
32+
33+ from datetime import datetime , timedelta , timezone
3434
3535from fledge .common import statistics
3636from fledge .common .audit_logger import AuditLogger
@@ -134,8 +134,8 @@ async def purge_data(self, config):
134134 unsent_retained = 0
135135 duration = 0
136136 method = None
137- timezone = pytz . timezone ( 'UTC' ) # You can replace 'UTC' with your desired timezone
138- start_time = datetime .now (timezone ). strftime ( '%Y-%m-%d %H:%M:%S.%f %Z%z ' )
137+
138+ start_time = datetime .now (timezone . utc ). isoformat ( ' ' )
139139
140140 if config ['retainUnsent' ]['value' ].lower () == "purge unsent" :
141141 flag = "purge"
@@ -241,7 +241,7 @@ async def purge_data(self, config):
241241 # skip logging as its already done in details for this operation in case of error
242242 # FIXME: check if ex.error jdoc has retryable True then retry the operation else move on
243243 pass
244- end_time = datetime .now (timezone ). strftime ( '%Y-%m-%d %H:%M:%S.%f %Z%z ' )
244+ end_time = datetime .now (timezone . utc ). isoformat ( ' ' )
245245
246246 if total_rows_removed > 0 :
247247 """ Only write an audit log entry when rows are removed """
You can’t perform that action at this time.
0 commit comments