-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_sync.py
38 lines (31 loc) · 946 Bytes
/
run_sync.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import traceback
import db_file as db
# import dir_utils
# import mattermost_client
# import mattermost_communication
import sync_gitmate as sync
def sync_files_to_gitea():
repo, api_handler = sync.init_sync()
# print(db.get_files().items())
for file_id, file_info in db.get_files().items():
# print(file_id, file_info)
try:
sync.sync_file(repo, api_handler, file_info)
except Exception as e:
print("Critical error: Failed to sync file to Gitea")
traceback.print_exc()
def sync_gitmate():
print()
print("================================================")
print("== Syncing files to git ==")
sync_files_to_gitea()
print()
return {
"synced": "success"
}
if __name__ == "__main__":
print()
print("================================================")
print("== Syncing files to git ==")
sync_files_to_gitea()
print()