Skip to content

Commit 1014de7

Browse files
committed
add force variable for metadata and db optimize
1 parent 37f6916 commit 1014de7

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
PORT=8062
22
BIND_ADDRESS=0.0.0.0
33
FORCE_FILE_REBUILD=0
4+
FORCE_METADATA_RESYNC=0
45
DEBUG=0
56
NODE_ENV=dev
67
# Memory Impacting Settings - Trades for threading efficiency. Much slower, but should be useful for limited memory environments like VPS
@@ -29,4 +30,4 @@ ELASTICSEARCH_URL=http://localhost:9200
2930

3031
#IGDB Connection Configuration - Not setting this will disable the new search page and metadata pull
3132
TWITCH_CLIENT_ID=
32-
TWITCH_CLIENT_SECRET=
33+
TWITCH_CLIENT_SECRET=

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
- PORT=8062
88
- BIND_ADDRESS=0.0.0.0
99
- FORCE_FILE_REBUILD=0
10+
- FORCE_METADATA_RESYNC=0
11+
- FORCE_DB_OPTIMIZE=0
1012
- DEBUG=0
1113
- HOSTNAME=myrient.mahou.one
1214
- NODE_ENV=production

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async function getFilesJob() {
115115

116116
async function updateMetadata() {
117117
if (updatingFiles) return;
118-
if ((await Metadata.count()) < (await metadataManager.getIGDBGamesCount())) {
118+
if ((await Metadata.count()) < (await metadataManager.getIGDBGamesCount()) || process.env.FORCE_METADATA_RESYNC == "1") {
119119
await metadataManager.syncAllMetadata();
120120
if (await Metadata.count()) {
121121
await metadataManager.matchAllMetadata();
@@ -128,7 +128,7 @@ async function updateMetadata() {
128128

129129
async function updateKws() {
130130
if (updatingFiles) return;
131-
if (!(await File.count({ where: { filenamekws: { [Op.ne]: null } } }))) {
131+
if (!(await File.count({ where: { filenamekws: { [Op.ne]: null } } })) || process.env.FORCE_DB_OPTIMIZE == "1") {
132132
await optimizeDatabaseKws();
133133
}
134134
}

0 commit comments

Comments
 (0)