diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-05-25 02:04:12 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-05-25 02:04:12 +0200 |
commit | fabcb28aa96a16c67a45d31696d87cc5df41d28e (patch) | |
tree | 162b4fc965d85de015d0b3f92d5f5add4f141c98 /src | |
parent | 1.3.4 (diff) | |
download | server-fabcb28aa96a16c67a45d31696d87cc5df41d28e.tar.xz |
:bug: fix Snowflake workerid
Diffstat (limited to 'src')
-rw-r--r-- | src/util/Snowflake.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/Snowflake.ts b/src/util/Snowflake.ts index e8056fc4..1d725710 100644 --- a/src/util/Snowflake.ts +++ b/src/util/Snowflake.ts @@ -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.`); |