Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2646 from FlorianKuckelkorn/fix-deprecated-python…
Browse files Browse the repository at this point in the history
…-client

removed deprecated task acking
  • Loading branch information
apanicker-nflx authored Dec 15, 2021
2 parents 206d913 + 6e08747 commit c6dcad4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion polyglot-clients/python/conductor/ConductorWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def poll_and_execute(self, taskType, exec_function, domain=None):
time.sleep(float(self.polling_interval))
polled = self.taskClient.pollForTask(taskType, self.worker_id, domain)
if polled is not None:
self.taskClient.ackTask(polled['taskId'], self.worker_id)
self.execute(polled, exec_function)

def start(self, taskType, exec_function, wait, domain=None):
Expand Down
8 changes: 0 additions & 8 deletions polyglot-clients/python/conductor/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ def pollForBatch(self, taskType, count, timeout, workerid, domain=None):
print('Error while polling ' + str(err))
return None

def ackTask(self, taskId, workerid):
url = self.makeUrl('{}/ack', taskId)
params = {}
params['workerid'] = workerid
headers = {'Accept': 'application/json'}
value = self.post(url, params, None, headers)
return value in ['true', True]

def getTasksInQueue(self, taskName):
url = self.makeUrl('queue/{}', taskName)
return self.get(url)
Expand Down
10 changes: 0 additions & 10 deletions polyglot-clients/python/test_conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ def test_pollForBatch(requests_get):
params={'workerid': 'barWorker', 'count': 20, 'timeout': 100, 'domain': 'a_domain'})


@mock.patch('requests.post')
def test_ackTask(requests_post):
task_client = TaskClient('base')
task_client.ackTask('42', 'myWorker')
requests_post.assert_called_with(
'base/tasks/42/ack',
headers={'Content-Type': 'application/json', 'Accept': 'application/json'},
params={'workerid': 'myWorker'})


@mock.patch('requests.post')
def test_updateTask(post):
task_client = TaskClient('base')
Expand Down

0 comments on commit c6dcad4

Please sign in to comment.