Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(snowflake): fix error shift
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Sep 24, 2019
1 parent fede29c commit 2f539b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnes/uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f539b7

Please sign in to comment.