Commit cccb79ee authored by sim's avatar sim

wip redis

parent 9f6a0000
...@@ -18,7 +18,7 @@ flower = "*" ...@@ -18,7 +18,7 @@ flower = "*"
django = ">=1.11,<1.12" django = ">=1.11,<1.12"
dateutils = "*" dateutils = "*"
celery = "*" celery = {extras = ["redis"]}
sqlalchemy = "*" sqlalchemy = "*"
"psycopg2" = "*" "psycopg2" = "*"
sqlalchemy-utils = "*" sqlalchemy-utils = "*"
......
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "2f8c66744c1e0e254f4b14435aa1df7a55e95a3467ed8d0bfa4478ee6013ed4d" "sha256": "7d00ec381e78d4d346a617e6e8644ab1c96e64cdae6408593e3018faee19e0f4"
}, },
"host-environment-markers": { "host-environment-markers": {
"implementation_name": "cpython", "implementation_name": "cpython",
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
"os_name": "posix", "os_name": "posix",
"platform_machine": "x86_64", "platform_machine": "x86_64",
"platform_python_implementation": "CPython", "platform_python_implementation": "CPython",
"platform_release": "4.9.0-4-amd64", "platform_release": "4.9.0-5-amd64",
"platform_system": "Linux", "platform_system": "Linux",
"platform_version": "#1 SMP Debian 4.9.51-1 (2017-09-28)", "platform_version": "#1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04)",
"python_full_version": "3.5.3", "python_full_version": "3.5.3",
"python_version": "3.5", "python_version": "3.5",
"sys_platform": "linux" "sys_platform": "linux"
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
"default": { "default": {
"alembic": { "alembic": {
"hashes": [ "hashes": [
"sha256:042851ebe9efa07be6dc1395b1793b6c1d8964a39b73a0ce1649e2bcd41ea732" "sha256:46f4849c6dce69f54dd5001b3215b6a983dee6b17512efee10e237fa11f20cfa"
], ],
"version": "==0.9.6" "version": "==0.9.7"
}, },
"amqp": { "amqp": {
"hashes": [ "hashes": [
...@@ -206,6 +206,13 @@ ...@@ -206,6 +206,13 @@
], ],
"version": "==2017.3" "version": "==2017.3"
}, },
"redis": {
"hashes": [
"sha256:8a1900a9f2a0a44ecf6e8b5eb3e967a9909dfed219ad66df094f27f7d6f330fb",
"sha256:a22ca993cea2962dbb588f9f30d0015ac4afcc45bee27d3978c0dbe9e97c6c0f"
],
"version": "==2.10.6"
},
"six": { "six": {
"hashes": [ "hashes": [
"sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb",
...@@ -215,9 +222,9 @@ ...@@ -215,9 +222,9 @@
}, },
"sqlalchemy": { "sqlalchemy": {
"hashes": [ "hashes": [
"sha256:9ede7070d6fd18f28058be88296ed67893e2637465516d6a596cd9afea97b154" "sha256:64b4720f0a8e033db0154d3824f5bf677cf2797e11d44743cf0aebd2a0499d9d"
], ],
"version": "==1.2.1" "version": "==1.2.2"
}, },
"sqlalchemy-utils": { "sqlalchemy-utils": {
"hashes": [ "hashes": [
...@@ -243,10 +250,10 @@ ...@@ -243,10 +250,10 @@
}, },
"astroid": { "astroid": {
"hashes": [ "hashes": [
"sha256:badf6917ef7eb0ade0ea6eae347aed1e3f8f4c9375a02916f5cc450b3c8a64c0", "sha256:db5cfc9af6e0b60cd07c19478fb54021fc20d2d189882fbcbc94fc69a8aecc58",
"sha256:71dadba2110008e2c03f9fde662ddd2053db3c0489d0e03c94e828a0399edd4f" "sha256:f0a0e386dbca9f93ea9f3ea6f32b37a24720502b7baa9cb17c3976a680d43a06"
], ],
"version": "==1.6.0" "version": "==1.6.1"
}, },
"babel": { "babel": {
"hashes": [ "hashes": [
...@@ -339,10 +346,10 @@ ...@@ -339,10 +346,10 @@
}, },
"pylint": { "pylint": {
"hashes": [ "hashes": [
"sha256:c8e59da0f2f9990eb00aad1c1de16cd7809315842ebccc3f65ca9df46213df3b", "sha256:156839bedaa798febee72893beef00c650c2e7abafb5586fc7a6a56be7f80412",
"sha256:3035e44e37cd09919e9edad5573af01d7c6b9c52a0ebb4781185ae7ab690458b" "sha256:4fe3b99da7e789545327b75548cee6b511e4faa98afe268130fea1af4b5ec022"
], ],
"version": "==1.8.1" "version": "==1.8.2"
}, },
"pylint-celery": { "pylint-celery": {
"hashes": [ "hashes": [
...@@ -352,9 +359,10 @@ ...@@ -352,9 +359,10 @@
}, },
"pylint-django": { "pylint-django": {
"hashes": [ "hashes": [
"sha256:b8e51d6b694401e23040ddafc3a4c7da92faaa1718b007ad66aa36e40ec84506" "sha256:3ed4117b5d845e3555cac76938bbfe158e85d6887f3f763f94bc48e91177cb84",
"sha256:7a3267eb4513ece61889cbf406d98752fd1a998bcb408eec7d21262358f8f790"
], ],
"version": "==0.7.2" "version": "==0.9.0"
}, },
"pylint-plugin-utils": { "pylint-plugin-utils": {
"hashes": [ "hashes": [
......
...@@ -53,8 +53,8 @@ def simulate_work(self): ...@@ -53,8 +53,8 @@ def simulate_work(self):
logger.info("Start %r", self) logger.info("Start %r", self)
for i in range(10): for i in range(10):
time.sleep(1) time.sleep(1)
self.update_state(state="PROGRESS", meta={'progress': 1/(10-i)})
if i > 0 and i % 5 == 0: if i > 0 and i % 5 == 0:
self.update_state(state="PROGRESS", meta={'progress': 1/10*i})
logger.info("50%% done %r", self) logger.info("50%% done %r", self)
logger.info("Finished %r", self) logger.info("Finished %r", self)
......
...@@ -204,7 +204,7 @@ MEDIA_URL = '/media/' ...@@ -204,7 +204,7 @@ MEDIA_URL = '/media/'
# Asynchronous tasks # Asynchronous tasks
BROKER_URL = config('BROKER_URL', default='amqp://guest:guest@localhost:5672/') BROKER_URL = config('BROKER_URL', default='redis://')
CELERY_APP = config('CELERY_APP', default='gargantext.backend') CELERY_APP = config('CELERY_APP', default='gargantext.backend')
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml'] CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
...@@ -216,7 +216,7 @@ CELERY_IMPORTS = () ...@@ -216,7 +216,7 @@ CELERY_IMPORTS = ()
CELERY_ACKS_LATE = True CELERY_ACKS_LATE = True
CELERYD_PREFETCH_MULTIPLIER = 1 CELERYD_PREFETCH_MULTIPLIER = 1
CELERY_TRACK_STARTED = True CELERY_TRACK_STARTED = True
CELERY_RESULT_BACKEND = 'rpc://' CELERY_RESULT_BACKEND = 'redis://'
# REST-API # REST-API
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment