Skip to content

Commit 235e5ad

Browse files
authored
Merge pull request #142 from Drazzilb08/dev
Dev
2 parents c2fb4db + 9b95cf2 commit 235e5ad

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.4
1+
1.0.5

main.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ def main():
204204

205205
# Check for scheduled scripts
206206
for script_name, schedule_time in scripts_schedules.items():
207+
208+
# Check if script_name is in already_run or not
209+
if script_name in already_run and schedule_time != "run" and already_run[script_name]:
210+
logger.debug(f"Script: {script_name} has already run setting already_run[{script_name}] to False")
211+
already_run[script_name] = False
212+
elif script_name in already_run and schedule_time == "run" and already_run[script_name]:
213+
logger.debug(f"Script is still set to run: {script_name}")
207214

208215
if script_name in running_scripts or not schedule_time:
209216
continue
@@ -212,6 +219,7 @@ def main():
212219
if schedule_time == "run" and (script_name not in already_run or not already_run[script_name]):
213220
process = run_module(script_name, logger)
214221
running_scripts[script_name] = process
222+
logger.debug(f"Setting already_run[{script_name}] to True")
215223
already_run[script_name] = True
216224
elif schedule_time != "run" and check_schedule(script_name, schedule_time, logger):
217225
process = run_module(script_name, logger)
@@ -225,7 +233,6 @@ def main():
225233
logger.debug(f"already_run:\n{json.dumps(already_run, indent=4)}")
226234
for script_name in processes_to_remove:
227235
logger.info(f"Script: {script_name.upper()} has finished")
228-
already_run[script_name] = False
229236
if script_name in running_scripts:
230237
del running_scripts[script_name]
231238
waiting_message_shown = False

0 commit comments

Comments
 (0)