Skip to content

Commit

Permalink
Update from monotonic to time module
Browse files Browse the repository at this point in the history
  • Loading branch information
rudyardrichter committed Sep 15, 2023
1 parent 1c44a93 commit 231fb56
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions analytics/consumer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import time
from threading import Thread
import json
import monotonic
import backoff


Expand Down Expand Up @@ -81,11 +81,11 @@ def next(self):
queue = self.queue
items = []

start_time = monotonic.monotonic()
start_time = time.monotonic()
total_size = 0

while len(items) < self.upload_size:
elapsed = monotonic.monotonic() - start_time
elapsed = time.monotonic() - start_time
if elapsed >= self.upload_interval:
break
try:
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ MarkupSafe==2.1.3
mccabe==0.6.1
mistune==0.8.4
mock==2.0.0
monotonic==1.6
multidict==5.1.0
packaging==21.0
pbr==5.11.1
Expand Down
6 changes: 3 additions & 3 deletions segment/analytics/consumer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import time
from threading import Thread
import monotonic
import backoff
import json

Expand Down Expand Up @@ -80,11 +80,11 @@ def next(self):
queue = self.queue
items = []

start_time = monotonic.monotonic()
start_time = time.monotonic()
total_size = 0

while len(items) < self.upload_size:
elapsed = monotonic.monotonic() - start_time
elapsed = time.monotonic() - start_time
if elapsed >= self.upload_interval:
break
try:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

install_requires = [
"requests~=2.7",
"monotonic~=1.5",
"backoff~=2.1",
"python-dateutil~=2.2"
]
Expand Down

0 comments on commit 231fb56

Please sign in to comment.