Skip to content

Commit

Permalink
Reduced Logging Fixed Uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
TheManWhoLikesToCode committed Jan 19, 2024
1 parent 28374c7 commit 1f18159
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from flask_cors import CORS, cross_origin
from flask_apscheduler import APScheduler

from blackboard_session import BlackboardSession

from file_management import clean_up_session_files, delete_session_files, view_in_drive_folder, update_drive_directory, clean_up_docs_files, remove_file_safely, is_file_valid, authorize_drive, get_session_files_path, file_name_from_path
from blackboard_session_manager import BlackboardSessionManager
import config
Expand All @@ -22,6 +22,8 @@

# Initialize Logging
logging.basicConfig(level=logging.INFO)
log_level = logging.WARNING
app.logger.setLevel(log_level)

# Import dot env variables
load_dotenv()
Expand All @@ -34,7 +36,7 @@ def clean_up_and_upload_files_to_google_drive(file_path=None):
remove_file_safely(file_path)

try:
clean_up_session_files(True)
clean_up_session_files(False)
delete_session_files()
update_drive_directory(drive, team_drive_id)
clean_up_docs_files()
Expand Down Expand Up @@ -63,8 +65,6 @@ def delete_inactive_bb_sessions(inactivity_threshold_seconds=180):
for username in usernames_to_delete:
bb_session_manager.delete_bb_session(username)

print("Deleting inactive sessions at:", time.time())


@app.route('/')
@cross_origin()
Expand Down Expand Up @@ -153,7 +153,6 @@ def trigger_post_download_operations(response):
@app.route('/browse/<path:path>')
@cross_origin()
def list_directory(path):
print("Requested Path:", path)

if path is None:
path = team_drive_id
Expand All @@ -173,7 +172,6 @@ def handle_single_file(file_id, file_name):
full_path = os.path.join(session_files_path, file_name)

file = drive.CreateFile({'id': file_id})
print('Downloading file %s from Google Drive' % file_name)
file.GetContentFile(full_path)

@after_this_request
Expand Down

0 comments on commit 1f18159

Please sign in to comment.