Skip to content

Commit

Permalink
[IMP] Fix date format in project sync and improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Feb 27, 2025
1 parent 51c4632 commit 8886f86
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sponsorship_compassion/models/project_compassion.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,18 @@ def sync_projects_from_gmc(
projects_to_sync = self.search(
[
("status", "in", ["Active", "Suspended"]),
("last_update_date", "<", one_month_ago),
("last_update_date", "<", fields.Date.to_string(one_month_ago)),
("sponsorships_count", ">", 0),
],
limit=max_projects_to_sync,
)
nb_projects_to_sync = len(projects_to_sync)

_logger.info(
f"Starting projects sync from GMC. {projects_to_sync=}, "
f"Estimated duration: "
f"{requests_throttle_seconds * nb_projects_to_sync} seconds."
"Starting projects sync from GMC. projects_to_sync=%s,"
"Estimated duration: %s seconds.",
nb_projects_to_sync,
requests_throttle_seconds * nb_projects_to_sync
)
for i, p in enumerate(projects_to_sync):
# Only synchronise projects for which we have sponsorships to speedup
Expand Down

0 comments on commit 8886f86

Please sign in to comment.