Commit e3293dff authored by echel0n's avatar echel0n

Merge branch 'release-v9.4.154'

parents 3fabae4d 397ac97c
......@@ -80,16 +80,16 @@ deploy_docker_develop:
- branches
- triggers
#deploy_synology:
# stage: deploy
# variables:
# UPSTREAM_BRANCH: master
# UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA
# trigger:
# project: sickrage/sickrage-synology
# branch: master
# only:
# - /^[0-9.]+$/
# except:
# - branches
# - triggers
\ No newline at end of file
deploy_synology:
stage: deploy
variables:
UPSTREAM_BRANCH: master
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA
trigger:
project: sickrage/sickrage-synology
branch: master
only:
- /^[0-9.]+$/
except:
- branches
- triggers
\ No newline at end of file
# Changelog
- * 4fd9b6613 - 2019-07-22: Enabled Synology package builds.
- * 2a8a136b0 - 2019-07-22: Added database integrity check, shuts down SR if corrupt database is detected. Added fatal loggger function to log critical error and exit application.
- * 3079a6fca - 2019-07-21: Pre-Release v9.4.154.dev1
- * ae1a14e49 - 2019-07-21: Release v9.4.153
- * ec617701d - 2019-07-21: Disabled deploying native Synology packages till Python 3.6.8 issues are resolved by Synocommunity.
- * 23a244210 - 2019-07-21: Resolved `TypeError_manage_failed_downloads_mako in render_content 'FailedSnatch' object is not subscriptable` Fixes SICKRAGE-APP-PY3-129
- * 8c7316b21 - 2019-07-21: Added check for show object to see if NoneType when search TV show cache.
......
......@@ -262,6 +262,9 @@ class Core(object):
# perform database startup actions
for db in [self.main_db, self.cache_db]:
# perform integrity check
db.integrity_check()
# migrate database
db.migrate()
......
......@@ -2462,8 +2462,7 @@ class ConfigMigrator(Config):
sickrage.app.log.info("Backing up config before upgrade")
if not backup_versioned_file(sickrage.app.config_file, current_version):
sickrage.app.log.exit("Config backup failed, abort upgrading config")
sys.exit(1)
sickrage.app.log.fatal("Config backup failed, abort upgrading config")
else:
sickrage.app.log.info("Proceeding with upgrade")
......
......@@ -167,6 +167,12 @@ class SRDatabase(object):
except DatabaseNotControlledError:
return 0
def integrity_check(self):
if self.db_type == 'sqlite':
if self.session().scalar("PRAGMA integrity_check") != "ok":
sickrage.app.log.fatal("{} database file {} is damaged, please restore a backup"
" or delete the database file and restart SiCKRAGE".format(self.name.capitalize(), self.db_path))
def sync_db_repo(self):
if self.version < self.db_version:
if self.db_type == 'sqlite':
......
......@@ -233,5 +233,9 @@ class Logger(logging.getLoggerClass()):
def warning(self, msg, *args, **kwargs):
super(Logger, self).warning(msg, *args, **kwargs)
def fatal(self, msg, *args, **kwargs):
super(Logger, self).fatal(msg, *args, **kwargs)
sys.exit(1)
def close(self, *args, **kwargs):
logging.shutdown()
9.4.153
\ No newline at end of file
9.4.154
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment