mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 13:14:06 +01:00
🐛 fix Snowflake workerid
This commit is contained in:
parent
8205cb3aad
commit
fabcb28aa9
@ -14,7 +14,7 @@ export class Snowflake {
|
||||
static readonly EPOCH = 1420070400000;
|
||||
static INCREMENT = 0n; // max 4095
|
||||
static processId = BigInt(process.pid % 31); // max 31
|
||||
static workerId = BigInt(cluster.worker.id % 31); // max 31
|
||||
static workerId = BigInt((cluster.worker?.id || 0) % 31); // max 31
|
||||
|
||||
constructor() {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
|
Loading…
Reference in New Issue
Block a user