This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/tools/backfilluploadingflag.py

21 lines
770 B
Python

import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
logging.getLogger('boto').setLevel(logging.CRITICAL)
from data.database import ImageStorage
from app import storage
for image_storage in ImageStorage.select().where(ImageStorage.uploading == None):
mark_path = storage.image_mark_path(None, None, None, image_storage.uuid)
json_path = storage.image_json_path(None, None, None, image_storage.uuid)
logger.info('Mark path: %s Json path: %s', mark_path, json_path)
if storage.exists(json_path):
image_storage.uploading = storage.exists(mark_path)
logger.info('Image existed and was currently uploading: %s', image_storage.uploading)
image_storage.save()
else:
logger.warning('Image does not exist.')