Skip to content

Commit b3ad125

Browse files
Merge pull request #100 from kylegibson/add_is_task_published_helper_method
Add is_task_published helper method
2 parents f445524 + e1bdf2b commit b3ad125

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
@@ -646,6 +646,17 @@ def wait_task(self, task_id, time_before_retry=100):
646646
return res
647647
time.sleep(time_before_retry / 1000.0)
648648

649+
def is_task_published(self, task_id):
650+
'''
651+
Return True if the task on the server has been published
652+
653+
@param task_id the id of the task returned by server
654+
'''
655+
656+
path = '/task/{0}'.format(task_id)
657+
res = self._req(True, path, 'GET')
658+
return res['status'] == 'published'
659+
649660
@deprecated
650661
def getSettings(self):
651662
return self.get_settings()

0 commit comments

Comments
 (0)