Skip to content

Commit

Permalink
feat: implement renew_lease for sqs
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Sep 1, 2023
1 parent 1d13d60 commit f164cd0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions taskqueue/aws_queue_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,16 @@ def add_insert_count(self, ct):
def rezero(self):
pass

def renew_lease(self, seconds):
raise NotImplementedError()
@retry
def renew_lease(self, task, seconds):
self.sqs.change_message_visibility(
QueueUrl=self.qurl,
ReceiptHandle=task.id,
VisibilityTimeout=seconds,
)

def cancel_lease(self, rhandle):
raise NotImplementedError()
def cancel_lease(self, task):
self.renew_lease(task, 0)

def release_all(self):
raise NotImplementedError()
Expand Down

0 comments on commit f164cd0

Please sign in to comment.