From ed3b3909ef28614ac80e1ce7a3e134161cf8db74 Mon Sep 17 00:00:00 2001 From: M1ha Date: Wed, 23 Jan 2019 16:30:04 +0500 Subject: [PATCH] Fix --- src/django_clickhouse/storages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/django_clickhouse/storages.py b/src/django_clickhouse/storages.py index 9d0b127..02fc1ce 100644 --- a/src/django_clickhouse/storages.py +++ b/src/django_clickhouse/storages.py @@ -210,12 +210,12 @@ class RedisStorage(Storage): lock.acquire() self._redis.set(lock_pid_key, os.getpid()) except RedisLockTimeoutError: - statsd.incr('clickhouse.sync.%s.lock.timeout' % import_key) + statsd.incr('%s.sync.%s.lock.timeout' % (config.STATSD_PREFIX, import_key)) # Lock is busy. But If the process has been killed, I don't want to wait any more. # Let's check if pid exists pid = int(self._redis.get(lock_pid_key) or 0) if pid and not check_pid(pid): - statsd.incr('clickhouse.sync.%s.lock.hard_release' % import_key) + statsd.incr('%s.sync.%s.lock.hard_release' % (config.STATSD_PREFIX, import_key)) logger.warning('django-clickhouse: hard releasing lock "%s" locked by pid %d (process is dead)' % (import_key, pid)) self._redis.delete(lock_pid_key)