fixed stuff
This commit is contained in:
parent
8acdcae7de
commit
c712395d39
56
Flask/app.py
56
Flask/app.py
@ -58,33 +58,37 @@ def update_jobs():
|
||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
for i in configs:
|
||||
h, m = configs[i]["time"].split(":")
|
||||
print("\033[36m" + f"config {i} : {h}:{m}" + "\033[0m")
|
||||
TriggerDict[i] = CronTrigger(
|
||||
year="*", month="*", day="*", hour=h, minute=m, second="0"
|
||||
)
|
||||
if configs[i]["enabled"]:
|
||||
try :
|
||||
scheduler.remove_job(i) # on reset le job
|
||||
except Exception as e:
|
||||
print(f"\033[33merror with deleting config {i} : {e}\033[0m")
|
||||
try :
|
||||
h, m = configs[i]["time"].split(":")
|
||||
print("\033[36m" + f"config {i} : {h}:{m}" + "\033[0m")
|
||||
TriggerDict[i] = CronTrigger(
|
||||
year="*", month="*", day="*", hour=h, minute=m, second="0"
|
||||
)
|
||||
if configs[i]["enabled"]:
|
||||
try :
|
||||
scheduler.remove_job(i) # on reset le job
|
||||
except Exception as e:
|
||||
print(f"\033[33merror with deleting config {i} : {e}\033[0m")
|
||||
|
||||
try :
|
||||
scheduler.add_job( # on relance le job
|
||||
start_ms, # ---
|
||||
trigger=TriggerDict[i], # ---
|
||||
args=[i], # ---
|
||||
name="Daily start", # ---
|
||||
id=i # ---
|
||||
)
|
||||
print("\033[36m" + f"successfully created config {i}" + "\033[0m")
|
||||
except Exception as e:
|
||||
print(f"\033[33merror with creating config {i} : {e}\033[0m")
|
||||
else :
|
||||
try :
|
||||
scheduler.remove_job(i)
|
||||
except Exception as e :
|
||||
print(f"\033[33merror with deleting config {i} : {e}\033[0m")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
try :
|
||||
scheduler.add_job( # on relance le job
|
||||
start_ms, # ---
|
||||
trigger=TriggerDict[i], # ---
|
||||
args=[i], # ---
|
||||
name="Daily start", # ---
|
||||
id=i # ---
|
||||
)
|
||||
print("\033[36m" + f"successfully created config {i}" + "\033[0m")
|
||||
except Exception as e:
|
||||
print(f"\033[33merror with creating config {i} : {e}\033[0m")
|
||||
else :
|
||||
try :
|
||||
scheduler.remove_job(i)
|
||||
except Exception as e :
|
||||
print(f"\033[33merror with deleting config {i} : {e}\033[0m")
|
||||
|
||||
def edit_version():
|
||||
with open("/app/MsRewards-Reborn/version", "r") as f:
|
||||
|
@ -39,10 +39,10 @@
|
||||
{%if not current_user.is_authenticated %}
|
||||
<h1>Already logged in</h1>
|
||||
{% else %}
|
||||
{{configs}}
|
||||
{% for i in configs %}
|
||||
|
||||
<option id="{{configs[i]['name']}}" value="{{i}}">{{configs[i]['name']}}</option>
|
||||
|
||||
{% for i in data %}
|
||||
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user