Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log processing time #137

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions importer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import requests
import logging
import backoff
from datetime import datetime
from oauthlib.oauth2 import LegacyApplicationClient
from requests_oauthlib import OAuth2Session

Expand Down Expand Up @@ -861,6 +862,9 @@ def main(
elif log_level == "ERROR":
logging.basicConfig(level=logging.ERROR)

start_time = datetime.now()
logging.info("Start time: " + start_time.strftime("%H:%M:%S"))

logging.info("Starting csv import...")
resource_list = read_csv(csv_file)
if resource_list:
Expand Down Expand Up @@ -939,6 +943,10 @@ def main(
else:
logging.error("Empty csv file!")

end_time = datetime.now()
logging.info("End time: " + end_time.strftime("%H:%M:%S"))
total_time = end_time - start_time
logging.info("Total time: " + str(total_time.total_seconds()) + " seconds")

if __name__ == "__main__":
main()
Loading