Skip to content

Commit

Permalink
Merge branch 'master' of github.com:frappe/press into feat-server-vol…
Browse files Browse the repository at this point in the history
…umes
  • Loading branch information
adityahase committed Dec 9, 2024
2 parents 2c069b9 + 37d240f commit 89ffd7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion press/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
"daily_long": [
"press.press.audit.check_bench_fields",
"press.press.audit.check_offsite_backups",
"press.press.audit.check_backup_records",
"press.press.audit.check_app_server_replica_benches",
"press.press.doctype.invoice.invoice.finalize_unpaid_prepaid_credit_invoices",
"press.press.doctype.bench.bench.sync_analytics",
Expand Down Expand Up @@ -235,6 +234,9 @@
"press.press.doctype.site.backups.cleanup_offsite",
"press.press.cleanup.unlink_remote_files_from_site",
],
"10 0 * * *": [
"press.press.audit.check_backup_records",
],
"0 3 * * *": [
"press.press.doctype.drip_email.drip_email.send_drip_emails",
],
Expand Down
4 changes: 2 additions & 2 deletions press/press/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_sites_with_backup_in_interval(self, trial_plans: tuple[str]):
WHERE
site.status = "Active" and
site_backup.owner = "Administrator" and
DATE(site_backup.creation) = "{self.yesterday}"
DATE(site_backup.creation) >= "{self.yesterday}"
{cond_filters}
"""
)
Expand Down Expand Up @@ -225,7 +225,7 @@ def get_sites_activated_yesterday(self):
for t in frappe.qb.from_(site_activites)
.select(site_activites.site)
.where(site_activites.action == "Activate Site")
.where(fn.Date(site_activites.creation) <= self.yesterday)
.where(fn.Date(site_activites.creation) >= self.yesterday)
.run()
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def delete_old_snapshots():
{"status": "Completed", "creation": ("<=", frappe.utils.add_days(None, -2))},
pluck="name",
order_by="creation asc",
limit=50,
limit=500,
)
for snapshot in snapshots:
try:
Expand Down Expand Up @@ -247,4 +247,5 @@ def _update_snapshot_if_exists(snapshot, random_snapshot):
"status",
random_snapshot.get_aws_status_map(snapshot["State"]),
)
return True
return False

0 comments on commit 89ffd7e

Please sign in to comment.