pull/884/head
Louis Vézina 5 years ago
parent a8e27a6a79
commit 1f82645e1d

@ -65,11 +65,11 @@ class DaemonStatus(ProcessRegistry):
remaining_processes.remove(ep)
else:
if remaining_time > 0:
try:
ep.wait(remaining_time)
remaining_processes.remove(ep)
except subprocess.TimeoutExpired:
pass
try:
ep.wait(remaining_time)
remaining_processes.remove(ep)
except subprocess.TimeoutExpired:
pass
elapsed = time.time() - reference_ts
remaining_time = timeout - elapsed
return remaining_processes

@ -128,7 +128,7 @@ def update_series():
for series in removed_series:
database.execute("DELETE FROM table_shows WHERE sonarrSeriesId=?",(series,))
event_stream.write(type='series', action='delete', series=series)
event_stream.write(type='series', action='delete', series=series)
# Update existing series in DB
series_in_db_list = []
@ -144,7 +144,7 @@ def update_series():
query = dict_converter.convert(updated_series)
database.execute('''UPDATE table_shows SET ''' + query.keys_update + ''' WHERE sonarrSeriesId = ?''',
query.values + (updated_series['sonarrSeriesId'],))
event_stream.write(type='series', action='update', series=updated_series['sonarrSeriesId'])
event_stream.write(type='series', action='update', series=updated_series['sonarrSeriesId'])
# Insert new series in DB
for added_series in series_to_add:
@ -158,7 +158,7 @@ def update_series():
logging.debug('BAZARR unable to insert this series into the database:',
path_replace(added_series['path']))
event_stream.write(type='series', action='insert', series=added_series['sonarrSeriesId'])
event_stream.write(type='series', action='insert', series=added_series['sonarrSeriesId'])
logging.debug('BAZARR All series synced from Sonarr into database.')

@ -224,24 +224,3 @@ class Scheduler:
upgrade_subtitles, IntervalTrigger(hours=int(settings.general.upgrade_frequency)), max_instances=1,
coalesce=True, misfire_grace_time=15, id='upgrade_subtitles',
name='Upgrade previously downloaded Subtitles', replace_existing=True)
scheduler.add_job(cache_maintenance, IntervalTrigger(hours=24), max_instances=1, coalesce=True,
misfire_grace_time=15, id='cache_cleanup', name='Cache maintenance')
schedule_update_job()
sonarr_full_update()
radarr_full_update()
schedule_wanted_search()
schedule_upgrade_subs()
scheduler.start()
if args.no_tasks:
scheduler.pause()
def add_job(job, name=None, max_instances=1, coalesce=True, args=None):
scheduler.add_job(job, DateTrigger(run_date=datetime.now()), name=name, id=name, max_instances=max_instances,
coalesce=coalesce, args=args)
def shutdown_scheduler():
scheduler.shutdown(wait=True)

Loading…
Cancel
Save