mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-26 18:33:09 +02:00
feat(backend): MasterプロセスのPIDを書き出せるように (#11909)
This commit is contained in:
parent
2039e244c5
commit
5ad0906c89
3 changed files with 18 additions and 11 deletions
|
@ -30,7 +30,7 @@ url: https://example.tld/
|
||||||
# The port that your Misskey server should listen on.
|
# The port that your Misskey server should listen on.
|
||||||
port: 3000
|
port: 3000
|
||||||
|
|
||||||
# You can also use UNIX domain socket.
|
# You can also use UNIX domain socket.
|
||||||
# socket: /path/to/misskey.sock
|
# socket: /path/to/misskey.sock
|
||||||
# chmodSocket: '777'
|
# chmodSocket: '777'
|
||||||
|
|
||||||
|
@ -60,17 +60,17 @@ dbReplications: false
|
||||||
# You can configure any number of replicas here
|
# You can configure any number of replicas here
|
||||||
#dbSlaves:
|
#dbSlaves:
|
||||||
# -
|
# -
|
||||||
# host:
|
# host:
|
||||||
# port:
|
# port:
|
||||||
# db:
|
# db:
|
||||||
# user:
|
# user:
|
||||||
# pass:
|
# pass:
|
||||||
# -
|
# -
|
||||||
# host:
|
# host:
|
||||||
# port:
|
# port:
|
||||||
# db:
|
# db:
|
||||||
# user:
|
# user:
|
||||||
# pass:
|
# pass:
|
||||||
|
|
||||||
# ┌─────────────────────┐
|
# ┌─────────────────────┐
|
||||||
#───┘ Redis configuration └─────────────────────────────────────
|
#───┘ Redis configuration └─────────────────────────────────────
|
||||||
|
@ -206,3 +206,6 @@ signToActivityPubGet: true
|
||||||
|
|
||||||
# Upload or download file size limits (bytes)
|
# Upload or download file size limits (bytes)
|
||||||
#maxFileSize: 262144000
|
#maxFileSize: 262144000
|
||||||
|
|
||||||
|
# PID File of master process
|
||||||
|
#pidFile: /tmp/misskey.pid
|
||||||
|
|
|
@ -63,6 +63,7 @@ export async function masterMain() {
|
||||||
showNodejsVersion();
|
showNodejsVersion();
|
||||||
config = loadConfigBoot();
|
config = loadConfigBoot();
|
||||||
//await connectDb();
|
//await connectDb();
|
||||||
|
if (config.pidFile) fs.writeFileSync(config.pidFile, process.pid.toString());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
bootLogger.error('Fatal error occurred during initialization', null, true);
|
bootLogger.error('Fatal error occurred during initialization', null, true);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
|
@ -89,6 +89,7 @@ type Source = {
|
||||||
perChannelMaxNoteCacheCount?: number;
|
perChannelMaxNoteCacheCount?: number;
|
||||||
perUserNotificationsMaxCount?: number;
|
perUserNotificationsMaxCount?: number;
|
||||||
deactivateAntennaThreshold?: number;
|
deactivateAntennaThreshold?: number;
|
||||||
|
pidFile: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Config = {
|
export type Config = {
|
||||||
|
@ -163,6 +164,7 @@ export type Config = {
|
||||||
perChannelMaxNoteCacheCount: number;
|
perChannelMaxNoteCacheCount: number;
|
||||||
perUserNotificationsMaxCount: number;
|
perUserNotificationsMaxCount: number;
|
||||||
deactivateAntennaThreshold: number;
|
deactivateAntennaThreshold: number;
|
||||||
|
pidFile: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const _filename = fileURLToPath(import.meta.url);
|
const _filename = fileURLToPath(import.meta.url);
|
||||||
|
@ -255,6 +257,7 @@ export function loadConfig(): Config {
|
||||||
perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000,
|
perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000,
|
||||||
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 300,
|
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 300,
|
||||||
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
||||||
|
pidFile: config.pidFile,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue