We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50e0d7a commit 2d44224Copy full SHA for 2d44224
webjobs/user_data_sync/start.py
@@ -1,11 +1,17 @@
1
+import sys
2
import constants
3
from models import database
4
from user_data_sync_service import UserDataSyncService
5
6
+def main():
7
+ try:
8
+ database.connect()
9
+ user_data_sync_service = UserDataSyncService()
10
+ user_data_sync_service.sync()
11
+ except:
12
+ print("Unexpected error: ", sys.exc_info()[0])
13
+ finally:
14
+ database.close()
15
-database.connect()
-
-user_data_sync_service = UserDataSyncService()
-user_data_sync_service.sync()
-database.close()
16
+if __name__ == "__main__":
17
+ main()
0 commit comments