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_continue. Is this expected? I was hoping that updates would be visible in API results in the seconds-to-minutes range, do I need to use a different API to get near this?
Here's my code, in case I've messed anything up 🙂
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.has_more:
for entry in list_result.entries:
log.info("scanned path: %s", entry.path_display)
list_result = client.files_list_folder_continue(list_result.cursor)
log.info("new cursor %s", list_result.cursor)
if poll_freq == 0:
return
else:
log.info("pause for %d seconds before next poll", poll_freq)
time.sleep(poll_freq)
list_result = client.files_list_folder_continue(list_result.cursor)
log.info("new cursor %s", list_result.cursor)