Revert "Continuing development."

This reverts commit 5d642ce2
pull/543/head
Louis Vézina 5 years ago
parent 5d642ce2e6
commit 35ea0775a5

@ -1,8 +1,10 @@
import os import os
import atexit
from get_args import args from get_args import args
from peewee import * from peewee import *
from playhouse.sqliteq import SqliteQueueDatabase from playhouse.sqliteq import SqliteQueueDatabase
from playhouse.reflection import generate_models
from helper import path_replace, path_replace_movie, path_replace_reverse, path_replace_reverse_movie from helper import path_replace, path_replace_movie, path_replace_reverse, path_replace_reverse_movie
@ -166,6 +168,11 @@ class TableSettingsNotifier(BaseModel):
table_name = 'table_settings_notifier' table_name = 'table_settings_notifier'
@atexit.register
def _stop_worker_threads():
database.stop()
def database_init(): def database_init():
database.start() database.start()
database.connect() database.connect()
@ -183,8 +190,3 @@ def database_init():
System.configured: 0 System.configured: 0
} }
).execute() ).execute()
def database_close():
if not database.is_closed():
database.close()

@ -22,8 +22,8 @@ import operator
from get_args import args from get_args import args
from init import * from init import *
from database import database_init, database_close, TableEpisodes, TableShows, TableMovies, TableHistory, \ from database import database_init, TableEpisodes, TableShows, TableMovies, TableHistory, TableHistoryMovie, \
TableHistoryMovie, TableSettingsLanguages, TableSettingsNotifier, System TableSettingsLanguages, TableSettingsNotifier, System
# Initiate database # Initiate database
database_init() database_init()
@ -187,7 +187,6 @@ def shutdown():
else: else:
stop_file.write('') stop_file.write('')
stop_file.close() stop_file.close()
database_close()
server.stop() server.stop()

Loading…
Cancel
Save