diff --git a/container/engine/dbUpdates/dbUpdate_2.15.sh b/container/engine/dbUpdates/dbUpdate_2.15.sh index 25ff4adc..e5cb759e 100755 --- a/container/engine/dbUpdates/dbUpdate_2.15.sh +++ b/container/engine/dbUpdates/dbUpdate_2.15.sh @@ -9,9 +9,11 @@ if [ ! $? = 0 ]; then ## BEGIN UPDATE ## # add column + sql "ALTER TABLE settings ADD COLUMN thunderstore_local_sync TINYINT;" sql "ALTER TABLE settings ADD COLUMN thunderstore_chunk_size INT;" # insert default setting + sql "UPDATE settings SET thunderstore_local_sync='1';" sql "UPDATE settings SET thunderstore_chunk_size='1000';" # exit diff --git a/container/engine/tools/tsSyncLocalParseMultithreaded.sh b/container/engine/tools/tsSyncLocalParseMultithreaded.sh index 9aa3b204..6648f9fe 100755 --- a/container/engine/tools/tsSyncLocalParseMultithreaded.sh +++ b/container/engine/tools/tsSyncLocalParseMultithreaded.sh @@ -1,7 +1,12 @@ #!/bin/bash source /opt/stateless/engine/includes/phvalheim-static.conf +syncEnabled=$(sql "SELECT thunderstore_local_sync FROM settings;") chunkSize=$(sql "SELECT thunderstore_chunk_size FROM settings;") +if [ ! $syncEnabled = 1 ]; then + exit +fi + /opt/stateless/engine/tools/sql "UPDATE systemstats SET tsSyncLocalLastExecStatus='running';" /opt/stateless/engine/tools/sql "UPDATE systemstats SET tsSyncLocalLastRun=NOW();"