File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 2626import schema_utils
2727from file_utils import FileType , read_from_file , write_to_file
2828
29-
30- # MAX_ROWS = 1
31- # Time is an env variable now
32- #TIME_THRESHOLD_IN_SEC = 300
33- time_threshold_in_sec = float (os .getenv ("TIME_THRESHOLD_IN_SEC" ))
34- #print(f"The type of time_threshold_in_sec is: {type(time_threshold_in_sec)}")
35-
3629def listening (collection_name : str ):
3730 logger = logging .getLogger (f"{ __name__ } [{ collection_name } ]" )
3831 db_name = os .getenv ("MONGO_DB_NAME" )
3932 logger .debug (f"db_name={ db_name } " )
4033 logger .debug (f"collection={ collection_name } " )
34+ # moved listening method so that it is called after the env variables are loaded
35+ time_threshold_in_sec = float (os .getenv ("TIME_THRESHOLD_IN_SEC" ))
4136 post_init_flush_done = False
4237
4338 table_dir = get_table_dir (collection_name )
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ def mirror():
4343 or not os .getenv ("TENANT_ID" )
4444 or not os .getenv ("INIT_LOAD_BATCH_SIZE" )
4545 or not os .getenv ("DELTA_SYNC_BATCH_SIZE" )
46+ # added threshold time
47+ or not os .getenv ("TIME_THRESHOLD_IN_SEC" )
4648 ):
4749 raise ValueError ("Missing environment variable." )
4850
You can’t perform that action at this time.
0 commit comments