Skip to content

Commit 319d2a3

Browse files
authored
Remove time stub from client (#11)
The client has a time stub with a comment indicating it's for time stubbing, but the test suite stubs time out in more traditional ways, so I believe this is an artifact of something that was intended to be used, but was not.
1 parent a06ad87 commit 319d2a3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/riverqueue/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class Client:
4848
def __init__(self, driver: DriverProtocol, advisory_lock_prefix=None):
4949
self.driver = driver
5050
self.advisory_lock_prefix = advisory_lock_prefix
51-
self.time_now_utc = lambda: datetime.now(timezone.utc) # for test time stubbing
5251

5352
def insert(
5453
self, args: Args, insert_opts: Optional[InsertOpts] = None
@@ -123,7 +122,7 @@ def __check_unique_job(
123122

124123
if unique_opts.by_period:
125124
lower_period_bound = self.__truncate_time(
126-
self.time_now_utc(), unique_opts.by_period
125+
datetime.now(timezone.utc), unique_opts.by_period
127126
)
128127

129128
any_unique_opts = True

0 commit comments

Comments
 (0)