Skip to content

Commit

Permalink
Merge pull request #262 from stakwork/revert/backup-retention-and-cro…
Browse files Browse the repository at this point in the history
…n-time

revet: reverted backup retention day 10 and cron time to daily
  • Loading branch information
tobi-bams authored Jul 23, 2024
2 parents 26e0637 + 992160a commit d000d49
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn bucket_name() -> String {

fn backup_retention_days() -> i64 {
match getenv("BACKUP_RETENTION_DAYS")
.unwrap_or("2".to_string())
.unwrap_or("10".to_string())
.parse()
{
Ok(float_value) => return float_value,
Expand Down Expand Up @@ -300,10 +300,9 @@ pub async fn delete_old_backups(bucket: &str, retention_days: i64) -> Result<()>
pub async fn backup_and_delete_volumes_cron() -> Result<JobScheduler> {
log::info!(":backup and delete volumes");
let sched = JobScheduler::new().await?;
// @daily

sched
.add(Job::new_async("0 0 * * * *", |_uuid, _l| {
.add(Job::new_async("@daily", |_uuid, _l| {
Box::pin(async move {
if !BACK_AND_DELETE.load(Ordering::Relaxed) {
BACK_AND_DELETE.store(true, Ordering::Relaxed);
Expand Down

0 comments on commit d000d49

Please sign in to comment.