1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-22 02:31:36 +02:00

🐛 fix Snowflake workerid

This commit is contained in:
Flam3rboy 2021-05-25 02:04:12 +02:00
parent 8205cb3aad
commit fabcb28aa9

View File

@ -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.`);