Compare commits

..

2 Commits

2 changed files with 48 additions and 43 deletions

View File

@ -28,8 +28,8 @@ config = {
"log_level": "INFO", "log_level": "INFO",
# determines directory where videos should be stored, see formating option below # determines directory where videos should be stored, see formating option below, don't include trailing slash
"videos_dir": "videos", "video_dir": "videos",
# Folder structure that will be created, default is to save as: # Folder structure that will be created, default is to save as:
# {video_dir}/{camera_device_id}/{start.year}/{start.month}/{start.day}/ # {video_dir}/{camera_device_id}/{start.year}/{start.month}/{start.day}/
@ -37,7 +37,7 @@ config = {
# {video_dir}/{start.year}/{start.month}/{start.day}/{camera_device_id}/ # {video_dir}/{start.year}/{start.month}/{start.day}/{camera_device_id}/
"path_esn_first": True, "path_esn_first": True,
# default is set at 4, but set it to 64 if you feel the need for speed # default is set at 4, but we feel the need for speed
"num_of_threads_in_pool": 4 "num_of_threads_in_pool": 4
} }
``` ```

View File

@ -101,23 +101,27 @@ if __name__ == '__main__':
logging.info(f"EagleEyev3 version: {een.__version__}") logging.info(f"EagleEyev3 version: {een.__version__}")
results = cur.execute('select email from user')
list_of_users = [r[0] for r in results]
for user_email in list_of_users:
if een: if een:
if een.refresh_token == None or een.refresh_token == '':
# if you get out of sync, pull the refresh_token from the db to get the loop started result = cur.execute("select user.refresh_token from user where user.email = ?;", (user_email,))
result = cur.execute("select user.refresh_token from user where user.email = ?;", ("mcotton@mcottondesign.com",))
for row in result: for row in result:
een.refresh_token = row[0] een.refresh_token = row[0]
else:
# een object and refresh_token appear to be good
pass
else: else:
logging.error('een object is None') logging.error('een object is None')
een.login_tokens(code=None, cascade=True, refresh_token=een.refresh_token) een.login_tokens(code=None, cascade=True, refresh_token=een.refresh_token)
if een and een.current_user and 'email' in een.current_user:
result = cur.execute("select user.refresh_token, user.id from user where user.email = ?;", (een.current_user['email'],)) result = cur.execute("select user.refresh_token, user.id from user where user.email = ?;", (een.current_user['email'],))
for row in result: for row in result:
@ -156,7 +160,8 @@ if __name__ == '__main__':
# Here is where we send the list of files to be run in the multiprocessing pool # Here is where we send the list of files to be run in the multiprocessing pool
run([results, een, current_camera]) run([results, een, current_camera])
else:
logging.info(f"failed to login for {user_email}")