From 2f539b7ade255044d68b75a46b220f4888679005 Mon Sep 17 00:00:00 2001 From: felix Date: Tue, 24 Sep 2019 17:12:58 +0800 Subject: [PATCH] fix(snowflake): fix error shift --- gnes/uuid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnes/uuid.py b/gnes/uuid.py index 9f5ec38e..f9d10260 100644 --- a/gnes/uuid.py +++ b/gnes/uuid.py @@ -51,8 +51,8 @@ def __init__(self, self.max_counter_mask = -1 ^ -1 << self.counter_bits self.machine_shift = self.counter_bits - self.datacenter_shift = self.counter_bits + self.machine_shift - self.timestamp_shift = self.counter_bits + self.machine_shift + self.datacenter_shift + self.datacenter_shift = self.counter_bits + self.machine_bits + self.timestamp_shift = self.counter_bits + self.machine_bits + self.datacenter_bits self.twepoch = int(time.mktime(time.strptime('2019-01-01 00:00:00', "%Y-%m-%d %H:%M:%S"))) self.last_timestamp = -1