...
 
Commits (2)
[bumpversion]
current_version = 1.2.0
current_version = 1.2.1
commit = True
tag = True
......
......@@ -13,7 +13,7 @@ services:
image: rabbitmq:alpine
restart: always
app:
image: sherzinger/fractalis:1.2.0
image: sherzinger/fractalis:1.2.1
volumes:
- ./config/fractalis/config.py:/config.py
- ./config/fractalis/logging.yaml:/logging.yaml
......@@ -27,7 +27,7 @@ services:
- redis
- rabbitmq
worker:
image: sherzinger/fractalis:1.2.0
image: sherzinger/fractalis:1.2.1
volumes:
- ./config/fractalis/config.py:/config.py
- ./config/fractalis/logging.yaml:/logging.yaml
......
......@@ -9,21 +9,24 @@ def janitor():
file system while Fractalis is running.
"""
data_dir = os.path.join(app.config['FRACTALIS_TMP_DIR'], 'data')
tracked_ids = [key.split(':')[1] for key in redis.scan_iter('data:*')]
if not os.path.exists(data_dir):
for key in redis.scan_iter('data:*'):
redis.delete(key)
for task_id in tracked_ids:
async_result = celery.AsyncResult(task_id)
if async_result.state == 'SUCCESS':
redis.delete('data:{}'.format(task_id))
return
cached_files = [f for f in os.listdir(data_dir)
if os.path.isfile(os.path.join(data_dir, f))]
tracked_files = [key.split(':')[1] for key in redis.scan_iter('data:*')]
# clean cached files
for cached_file in cached_files:
if cached_file not in tracked_files:
if cached_file not in tracked_ids:
sync.remove_file(os.path.join(data_dir, cached_file))
# clean tracked files
for task_id in tracked_files:
for task_id in tracked_ids:
path = os.path.join(data_dir, task_id)
async_result = celery.AsyncResult(task_id)
if async_result.state == 'SUCCESS' and not os.path.exists(path):
......
......@@ -79,8 +79,7 @@ def get_all_data() -> Tuple[Response, int]:
for task_id in session['data_tasks']:
data_state = get_data_state_for_task_id(task_id, wait)
if data_state is None:
warning = "Data state with task_id '{}' expired. " \
"Discarding...".format(task_id)
warning = "Data state with task_id '{}' expired.".format(task_id)
logger.warning(warning)
continue
# remove internal information from response
......
......@@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
@misc_blueprint.route('/version', methods=['GET'])
def get_version() -> Tuple[Response, int]:
version = '1.2.0'
version = '1.2.1'
# this is a good place to launch the janitor because /version is one of the
# first requests sent by the front-end on initialization
janitor.delay()
......
......@@ -9,7 +9,7 @@ setup(
author='Sascha Herzinger',
author_email='sascha.herzinger@uni.lu',
url='https://git-r3lab.uni.lu/Fractalis/fractalis',
version='1.2.0',
version='1.2.1',
license='Apache2.0',
include_package_data=True,
python_requires='>=3.4.0',
......