From 20e4d385a576c6716c52cafaf4f0fb2d7a1fa10f Mon Sep 17 00:00:00 2001 From: Honza Maly Date: Fri, 17 Jan 2025 07:28:49 +0000 Subject: [PATCH] Convert timestamp to string, although maybe the other way around would be better ... --- github_backup/github_backup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/github_backup/github_backup.py b/github_backup/github_backup.py index 587c2a3..d845d5b 100644 --- a/github_backup/github_backup.py +++ b/github_backup/github_backup.py @@ -1123,7 +1123,8 @@ def backup_issues(args, repo_cwd, repository, repos_template): issue_file = "{0}/{1}.json".format(issue_cwd, number) if args.incremental_by_files and os.path.isfile(issue_file): modified = os.path.getmtime(issue_file) - if modified > issue["updated_at"] + modified = datetime.fromtimestamp(modified).strftime("%Y-%m-%dT%H:%M:%SZ") + if modified > issue["updated_at"]: logger.info("Skipping issue {0} because it wasn't modified since last backup".format(number)) continue @@ -1192,7 +1193,8 @@ def backup_pulls(args, repo_cwd, repository, repos_template): pull_file = "{0}/{1}.json".format(pulls_cwd, number) if args.incremental_by_files and os.path.isfile(pull_file): modified = os.path.getmtime(pull_file) - if modified > pull["updated_at"] + modified = datetime.fromtimestamp(modified).strftime("%Y-%m-%dT%H:%M:%SZ") + if modified > pull["updated_at"]: logger.info("Skipping pull request {0} because it wasn't modified since last backup".format(number)) continue if args.include_pull_comments or args.include_everything: