Skip to content

Commit e1bdf2b

Browse files
Implemented is_task_published helper method
1 parent 19eed1c commit e1bdf2b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

algoliasearch/index.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,17 @@ def wait_task(self, task_id, time_before_retry=100):
640640
return res
641641
time.sleep(time_before_retry / 1000.0)
642642

643+
def is_task_published(self, task_id):
644+
'''
645+
Return True if the task on the server has been published
646+
647+
@param task_id the id of the task returned by server
648+
'''
649+
650+
path = '/task/{0}'.format(task_id)
651+
res = self._req(True, path, 'GET')
652+
return res['status'] == 'published'
653+
643654
@deprecated
644655
def getSettings(self):
645656
return self.get_settings()

0 commit comments

Comments
 (0)