Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wxxiong6 committed Mar 26, 2023
1 parent e892a9c commit 17eaa04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snowflake.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ static uint64_t snowflake_id(snowflake *sf)
mtx->seq = (mtx->seq + 1) & sf->seq_mask;
if (mtx->seq == 0)
{
now = wait_next_ms(now)
now = wait_next_ms(now);
}
} else if (mtx->last_time - now <= 5) { //5ms内的时差
mtx->seq = 0;
now = wait_next_ms(now)
now = wait_next_ms(now);
}
else
{
Expand Down

0 comments on commit 17eaa04

Please sign in to comment.