This commit is contained in:
Joseph Schorr 2017-07-11 16:58:30 +03:00
parent bdab367285
commit 8ded8f573d
2 changed files with 5 additions and 4 deletions

View file

@ -11,9 +11,8 @@ from util.log import logfile_path
logger = logging.getLogger(__name__)
DELETION_DATE_THRESHOLD = timedelta(days=2)
BLOBUPLOAD_CLEANUP_FREQUENCY = app.config.get('BLOBUPLOAD_CLEANUP_FREQUENCY', 60*60)
BLOBUPLOAD_CLEANUP_FREQUENCY = app.config.get('BLOBUPLOAD_CLEANUP_FREQUENCY', 60 * 60)
class BlobUploadCleanupWorker(Worker):

View file

@ -2,8 +2,9 @@ from datetime import datetime, timedelta
from data import model
from data.database import BlobUpload as BlobUploadTable
from workers.blobuploadcleanupworker.models_interface import (BlobUpload,
BlobUploadCleanupWorkerDataInterface)
from workers.blobuploadcleanupworker.models_interface import (
BlobUpload, BlobUploadCleanupWorkerDataInterface)
class PreOCIModel(BlobUploadCleanupWorkerDataInterface):
def get_stale_blob_upload(self, stale_threshold):
@ -33,4 +34,5 @@ class PreOCIModel(BlobUploadCleanupWorkerDataInterface):
blob_upload = model.blob.get_blob_upload_by_uuid(upload_uuid)
return blob_upload is not None
pre_oci_model = PreOCIModel()