Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evekhm committed Jul 19, 2024
1 parent fc2b90a commit dec6b19
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions classify-split-extract-workflow/classify-job/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def load_config(bucket_name: str, filename: str) -> Optional[Dict[Any, Any]]:
Returns:
Optional[Dict[Any, Any]]: The configuration data.
"""
global BUCKET, CONFIG_DATA
global BUCKET, CONFIG_DATA, LAST_MODIFIED_TIME_OF_CONFIG
if not BUCKET:
BUCKET = init_bucket(bucket_name)

Expand All @@ -209,14 +209,12 @@ def load_config(bucket_name: str, filename: str) -> Optional[Dict[Any, Any]]:
return None

last_modified_time = blob.updated
global LAST_MODIFIED_TIME_OF_CONFIG
if LAST_MODIFIED_TIME_OF_CONFIG == last_modified_time:
return CONFIG_DATA

logger.info(f"Reloading config from: {filename}")
try:
CONFIG_DATA = json.loads(blob.download_as_text(encoding="utf-8"))
global LAST_MODIFIED_TIME_OF_CONFIG
LAST_MODIFIED_TIME_OF_CONFIG = last_modified_time
except (json.JSONDecodeError, OSError) as e:
logger.error(f"Error while obtaining file from GCS gs://{bucket_name}/{filename}: {e}")
Expand Down

0 comments on commit dec6b19

Please sign in to comment.