mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge remote-tracking branch 'origin/db-pools-backups' into db-pools-backups
This commit is contained in:
@@ -856,6 +856,8 @@ services:
|
||||
environment:
|
||||
- _APP_CONNECTIONS_DB_REPLICAS
|
||||
- _APP_CONNECTIONS_BACKUPS_STORAGE
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
|
||||
appwrite-restore:
|
||||
command: sleep infinity
|
||||
|
||||
@@ -18,8 +18,8 @@ class Backup extends Action
|
||||
public const BACKUPS_PATH = '/backups';
|
||||
public const BACKUP_INTERVAL_SECONDS = 60 * 60 * 4; // 4 hours;
|
||||
public const COMPRESS_ALGORITHM = 'zstd'; // https://www.percona.com/blog/get-your-backup-to-half-of-its-size-introducing-zstd-support-in-percona-xtrabackup/
|
||||
public const CLEANUP_LOCAL_FILES_SECONDS = 60 * 60 * 24 * 30; // 2 days?
|
||||
public const CLEANUP_CLOUD_FILES_SECONDS = 60 * 60 * 24 * 30; // 14 days?;
|
||||
public const CLEANUP_LOCAL_FILES_SECONDS = 60 * 60 * 24 * 7;
|
||||
public const CLEANUP_CLOUD_FILES_SECONDS = 60 * 60 * 24 * 7;
|
||||
public const UPLOAD_CHUNK_SIZE = 5 * 1024 * 1024; // Must be greater than 5MB;
|
||||
public const RETRY_BACKUP = 1;
|
||||
public const RETRY_TAR = 1;
|
||||
@@ -374,8 +374,7 @@ class Backup extends Action
|
||||
self::log('Clean cloud start');
|
||||
$start = microtime(true);
|
||||
$files = $this->s3->getFiles($this->s3->getRoot());
|
||||
|
||||
if ($files['KeyCount'] > 0) {
|
||||
if ($files['KeyCount'] > 1) { // Bug when is one returned it returns an object not an array!
|
||||
foreach ($files['Contents'] as $file) {
|
||||
$date = basename(basename($file['Key']), '.tar.gz');
|
||||
if ($this->isDelete($date, self::CLEANUP_CLOUD_FILES_SECONDS)) {
|
||||
|
||||
Reference in New Issue
Block a user