run all jobs on start
This commit is contained in:
parent
e07261deed
commit
0f713cdc53
|
@ -15,6 +15,9 @@ logger.setLevel(os.environ.get('SCHEDULER_LOG_LEVEL', 'INFO').upper())
|
||||||
database = {}
|
database = {}
|
||||||
prio = 0
|
prio = 0
|
||||||
head = {}
|
head = {}
|
||||||
|
with open('/config/epg.json', 'r') as json_file:
|
||||||
|
# Load the epg.json config file
|
||||||
|
epg_json = json.load(json_file)
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
api_hostname = os.environ.get('CORE_API_HOSTNAME')
|
api_hostname = os.environ.get('CORE_API_HOSTNAME')
|
||||||
|
@ -53,11 +56,6 @@ def find_event_entry(events, target_name):
|
||||||
return {"start_at": entry.get("start_at"), "prio": entry.get("prio")}
|
return {"start_at": entry.get("start_at"), "prio": entry.get("prio")}
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Load the epg.json config file
|
|
||||||
with open('/config/epg.json', 'r') as json_file:
|
|
||||||
# Load the JSON data from the file
|
|
||||||
epg_json = json.load(json_file)
|
|
||||||
|
|
||||||
def stream_exec(stream_name, stream_prio, stream_hls_url):
|
def stream_exec(stream_name, stream_prio, stream_hls_url):
|
||||||
global head
|
global head
|
||||||
print('Hello {}, your priority is'. format(stream_name, stream_prio))
|
print('Hello {}, your priority is'. format(stream_name, stream_prio))
|
||||||
|
@ -163,6 +161,8 @@ schedule.every(SYNC_PERIOD).minutes.do(core_api_sync)
|
||||||
schedule.every().minute.do(show_database)
|
schedule.every().minute.do(show_database)
|
||||||
schedule.every().minute.do(show_scheduled_tasks)
|
schedule.every().minute.do(show_scheduled_tasks)
|
||||||
|
|
||||||
|
schedule.run_all()
|
||||||
|
|
||||||
@app.route('/', methods=['GET'])
|
@app.route('/', methods=['GET'])
|
||||||
def root_query():
|
def root_query():
|
||||||
global head
|
global head
|
||||||
|
|
Loading…
Reference in a new issue