Skip to content

Commit

Permalink
added local sync enable/disable feature by thunderstore_local_sync da…
Browse files Browse the repository at this point in the history
…tabase key
  • Loading branch information
brianmiller committed Apr 13, 2024
1 parent 10d2168 commit b5d2fb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions container/engine/dbUpdates/dbUpdate_2.15.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions container/engine/tools/tsSyncLocalParseMultithreaded.sh
Original file line number Diff line number Diff line change
@@ -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();"

Expand Down

0 comments on commit b5d2fb6

Please sign in to comment.