Skip to content

Commit

Permalink
Change runtime if runtime is higher 2147483647 (#447)
Browse files Browse the repository at this point in the history
* change runtime if runtime is higher 2147483647

Co-authored-by: Carmen Tawalika <mmacata@users.noreply.github.com>

---------

Co-authored-by: anikaweinmann <aweinmann@mundialis.de>
Co-authored-by: Carmen Tawalika <mmacata@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 7, 2023
1 parent 8f438a4 commit c3c0989
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To lint your local changes, run
```
pip3 uninstall actinia_core
cd /src/actinia_core && pip3 install .
rq_custom_worker job_queue_0 -c /etc/default/actinia
actinia-worker job_queue_0 -c /etc/default/actinia
```

## Local dev-setup with configured endpoints
Expand Down
2 changes: 1 addition & 1 deletion redis_queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docker run --rm -it --entrypoint sh \
- inside container, start worker listening to specified queue
```
QUEUE_NAME=job_queue_0
rq_custom_worker $QUEUE_NAME -c /etc/default/actinia --quit
actinia-worker $QUEUE_NAME -c /etc/default/actinia --quit
```


Expand Down
8 changes: 6 additions & 2 deletions src/actinia_core/core/common/redis_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,18 @@ def __enqueue_job_redis(queue, timeout, func, *args):
"""

log.info("Enqueue job in queue %s" % queue.name)
# Below timeout is defined in resource_base.pyL295:
# Below timeout is defined in resource_base.pyL295.
# If it is higher than 2147483647, it will be set to never expire.
# Else it would raise an error:
# int(process_time_limit * process_num_limit * 20)
# which is 630720000000 and raises in worker:
# OverflowError: Python int too large to convert to C int
if timeout > 2147483647:
timeout = -1 # never exprire
ret = queue.enqueue(
func,
*args,
# job_timeout=timeout,
job_timeout=timeout,
ttl=global_config.REDIS_QUEUE_JOB_TTL,
result_ttl=global_config.REDIS_QUEUE_JOB_TTL
)
Expand Down

0 comments on commit c3c0989

Please sign in to comment.