Skip to content

Commit 20e4d38

Browse files
committed
Convert timestamp to string, although maybe the other way around would be better ...
1 parent a49322c commit 20e4d38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

github_backup/github_backup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,8 @@ def backup_issues(args, repo_cwd, repository, repos_template):
11231123
issue_file = "{0}/{1}.json".format(issue_cwd, number)
11241124
if args.incremental_by_files and os.path.isfile(issue_file):
11251125
modified = os.path.getmtime(issue_file)
1126-
if modified > issue["updated_at"]
1126+
modified = datetime.fromtimestamp(modified).strftime("%Y-%m-%dT%H:%M:%SZ")
1127+
if modified > issue["updated_at"]:
11271128
logger.info("Skipping issue {0} because it wasn't modified since last backup".format(number))
11281129
continue
11291130

@@ -1192,7 +1193,8 @@ def backup_pulls(args, repo_cwd, repository, repos_template):
11921193
pull_file = "{0}/{1}.json".format(pulls_cwd, number)
11931194
if args.incremental_by_files and os.path.isfile(pull_file):
11941195
modified = os.path.getmtime(pull_file)
1195-
if modified > pull["updated_at"]
1196+
modified = datetime.fromtimestamp(modified).strftime("%Y-%m-%dT%H:%M:%SZ")
1197+
if modified > pull["updated_at"]:
11961198
logger.info("Skipping pull request {0} because it wasn't modified since last backup".format(number))
11971199
continue
11981200
if args.include_pull_comments or args.include_everything:

0 commit comments

Comments
 (0)