mirror of
https://github.com/spacebarchat/server.git
synced 2026-11-09 16:59:04 +00:00
Use EnvConfig for proto settings logging, unify setting
This commit is contained in:
1 parent
d9d2a12bdc
commit
f467f94fce
2 files changed
+4
-6
No files matched your search
@@ -21,7 +21,7 @@ import { PreloadedUserSettings } from "discord-protos";
|
||||
import { JsonValue } from "@protobuf-ts/runtime";
|
||||
import { route } from "@spacebar/api/middlewares";
|
||||
import { UserSettingsProtos } from "@spacebar/database";
|
||||
import { emitEvent, OrmUtils } from "@spacebar/util";
|
||||
import { emitEvent, OrmUtils, EnvConfig } from "@spacebar/util";
|
||||
import { SettingsProtoJsonResponse, SettingsProtoResponse, SettingsProtoUpdateJsonSchema, SettingsProtoUpdateSchema } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
@@ -142,8 +142,7 @@ async function patchUserSettings(userId: string, updatedSettings: PreloadedUserS
|
||||
};
|
||||
}
|
||||
|
||||
if ((process.env.LOG_PROTO_UPDATES || process.env.LOG_PROTO_SETTINGS_UPDATES) && process.env.LOG_PROTO_SETTINGS_UPDATES !== "false")
|
||||
console.log(`Updating user settings for user ${userId} with atomic=${atomic}:`, updatedSettings);
|
||||
if (EnvConfig.logging.logProtoUpdates.includes("SETTINGS")) console.log(`Updating user settings for user ${userId} with atomic=${atomic}:`, updatedSettings);
|
||||
|
||||
if (!atomic) {
|
||||
settings = PreloadedUserSettings.fromJson(
|
||||
|
||||
@@ -21,7 +21,7 @@ import { FrecencyUserSettings } from "discord-protos";
|
||||
import { JsonValue } from "@protobuf-ts/runtime";
|
||||
import { route } from "@spacebar/api/middlewares";
|
||||
import { UserSettingsProtos } from "@spacebar/database";
|
||||
import { emitEvent, OrmUtils } from "@spacebar/util";
|
||||
import { emitEvent, OrmUtils, EnvConfig } from "@spacebar/util";
|
||||
import { SettingsProtoJsonResponse, SettingsProtoResponse, SettingsProtoUpdateJsonSchema, SettingsProtoUpdateSchema } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
@@ -142,8 +142,7 @@ async function patchUserSettings(userId: string, updatedSettings: FrecencyUserSe
|
||||
};
|
||||
}
|
||||
|
||||
if ((process.env.LOG_PROTO_UPDATES || process.env.LOG_PROTO_FRECENCY_UPDATES) && process.env.LOG_PROTO_FRECENCY_UPDATES !== "false")
|
||||
console.log(`Updating frecency settings for user ${userId} with atomic=${atomic}:`, updatedSettings);
|
||||
if (EnvConfig.logging.logProtoUpdates.includes("FRECENCY")) console.log(`Updating frecency settings for user ${userId} with atomic=${atomic}:`, updatedSettings);
|
||||
|
||||
if (!atomic) {
|
||||
settings = FrecencyUserSettings.fromJson(
|
||||
|
||||
Reference in new issue
Block a user