-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save synced filenams and skip sync next times (#454)
* feat: add synced file name in imported.json, then skip those files next time * chore: add TCX_OUT\FIT_OUT dir in `yarn data:clean` cli * reformated * fix: add try except when load json * save data files to cache * Revert "save data files to cache" This reverts commit cd3bcf9. * fix: new synced_data_file_logger.py * reformatted * save GPX/FIT/TCX, activities, accets, data.db to github cache * Revert "save GPX/FIT/TCX, activities, accets, data.db to github cache" This reverts commit 55f48cc. * resolve the code review issues. * fix: put all types data files record in one json * add update track data file names in the synced record file
- Loading branch information
Showing
5 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
from config import SYNCED_FILE | ||
import json | ||
|
||
|
||
def save_synced_data_file_list(file_list: list): | ||
old_list = load_synced_file_list() | ||
|
||
with open(SYNCED_FILE, "w") as f: | ||
file_list.extend(old_list) | ||
|
||
json.dump(file_list, f) | ||
|
||
|
||
def load_synced_file_list(): | ||
if os.path.exists(SYNCED_FILE): | ||
with open(SYNCED_FILE, "r") as f: | ||
try: | ||
return json.load(f) | ||
except Exception as e: | ||
print(f"json load {SYNCED_FILE} \nerror {e}") | ||
pass | ||
|
||
return [] |
085a585
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
running-page – ./
running-page.vercel.app
running-page-git-master-yihong0618.vercel.app
running-page-yihong0618.vercel.app