You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
RobinHarveyIW
4 years agoExplorer | Level 4
Update latency for files_list_folder cursor
I'm trialing the simple polling method outlined here, and AFAICS it's taking a few hours for changes in my DB folders / files to be reflected in the results of files_list_folder and files_list_folder...
RobinHarveyIW
4 years agoExplorer | Level 4
I figured out what the issue here was - it's the way my code was handling results pages and cursors. I switched the loop control checks around a bit and it all started working fine:
def poll_loop(client: DropboxClient,
db_path: str,
poll_freq: int,
db_cursor: str = None):
if db_cursor is None:
list_result = client.files_list_folder(path=db_path, recursive=True)
else:
list_result = client.files_list_folder_continue(db_cursor)
while True:
log.info("scan files from cursor %s", list_result.cursor)
while list_result.entries:
for entry in list_result.entries:
log.info("scanned path: %s", entry.path_display)
if list_result.has_more:
list_result = client.files_list_folder_continue(list_result.cursor)
log.debug("new cursor %s", list_result.cursor)
else:
log.debug("cursor is exhausted")
break
if poll_freq == 0:
log.info("final cursor: %s", list_result.cursor)
return
else:
log.debug("pause for %d seconds before next poll", poll_freq)
log.info("latest cursor: %s", list_result.cursor)
time.sleep(poll_freq)
list_result = client.files_list_folder_continue(list_result.cursor)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!