You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run_analytics() in GasExposureAnalytics.py is caching the timestamp key after the first time it's called, causing Duplicate Record exceptions on subsequent calls.
Root cause : there's a default argument in the method definition. Python default arguments are evaluated once when the function is defined, not each time the function is called. Hence the caching.
Also fixed in this PR:
Add some defensive code around the timestamp key, to ensure it's always (a) in UTC time and (b) does not have a timezone suffix (because mariadb does not support timezone aware timestamp datatypes).
Get the logging to respect the LOGLEVEL environment variable and consistently log against the filename, even if it changes (i.e. get rid of the hardcoded log names)
The text was updated successfully, but these errors were encountered:
JSegrave-IBM
changed the title
Fix issue where run_analytics() caches the timestamp key, causing Duplicate Key exceptions
Fix issue where run_analytics() caches the timestamp key, causing Duplicate Record exceptions
Nov 2, 2020
run_analytics()
in GasExposureAnalytics.py is caching the timestamp key after the first time it's called, causing Duplicate Record exceptions on subsequent calls.Root cause : there's a default argument in the method definition. Python default arguments are evaluated once when the function is defined, not each time the function is called. Hence the caching.
Also fixed in this PR:
LOGLEVEL
environment variable and consistently log against the filename, even if it changes (i.e. get rid of the hardcoded log names)The text was updated successfully, but these errors were encountered: