Add --reload flag to data synchronization script #12

Merged
nick merged 2 commits from feature/add-reload-flag-for-loading-data into master 2025-05-22 12:27:44 -04:00
Showing only changes of commit 3afe292b23 - Show all commits

4
app.py
View File

@ -336,10 +336,12 @@ def main():
fs = os.getenv('FS') fs = os.getenv('FS')
layer = os.getenv('LAYER') layer = os.getenv('LAYER')
logger.info("Truncating the feature layer.")
truncate(token, hostname, instance, fs, layer)
# If --reload flag is set, load data from the specified file # If --reload flag is set, load data from the specified file
if reload_file: if reload_file:
logger.info(f"Reloading data from file: {reload_file}") logger.info(f"Reloading data from file: {reload_file}")
truncate(token, hostname, instance, fs, layer) # Truncate the layer
# Load data from the specified file # Load data from the specified file
with open(reload_file, 'r', encoding='utf-8') as f: with open(reload_file, 'r', encoding='utf-8') as f: