m8chaa commited on
Commit
e7e8e54
·
verified ·
1 Parent(s): 787698a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -947,13 +947,15 @@ async def notifications(request: Request, background_tasks: BackgroundTasks):
947
  logging.info(f"Notification received: Channel ID: {channel_id}, Resource ID: {resource_id}, State: {resource_state}, URI: {resource_uri}, Changed: {changed}")
948
 
949
  if channel_id in app.state.drive_watcher.channels:
 
950
  channel_info = app.state.drive_watcher.channels[channel_id]
951
  user_id = channel_info['user_id']
952
  folder_id = channel_info['folder_id']
953
 
954
  logging.info(f"Notification is for user: {user_id}, folder: {folder_id}")
955
 
956
- if resource_state == 'change' and changed == 'content':
 
957
  try:
958
  # List files in the folder that have been recently modified
959
  results = app.state.drive_service.files().list(
 
947
  logging.info(f"Notification received: Channel ID: {channel_id}, Resource ID: {resource_id}, State: {resource_state}, URI: {resource_uri}, Changed: {changed}")
948
 
949
  if channel_id in app.state.drive_watcher.channels:
950
+ logging.info("channel id is in the drive watcher")
951
  channel_info = app.state.drive_watcher.channels[channel_id]
952
  user_id = channel_info['user_id']
953
  folder_id = channel_info['folder_id']
954
 
955
  logging.info(f"Notification is for user: {user_id}, folder: {folder_id}")
956
 
957
+ if resource_state == 'change' and changed == 'children':
958
+ logging.info("appropriate resource changed")
959
  try:
960
  # List files in the folder that have been recently modified
961
  results = app.state.drive_service.files().list(