mirror of https://github.com/peter4431/rq.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
501 B
Python
19 lines
501 B
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import (absolute_import, division, print_function,
|
|
unicode_literals)
|
|
|
|
from functools import partial
|
|
|
|
from redis import Redis
|
|
|
|
|
|
def fix_return_type(func):
|
|
# deliberately no functools.wraps() call here, since the function being
|
|
# wrapped is a partial, which has no module
|
|
def _inner(*args, **kwargs):
|
|
value = func(*args, **kwargs)
|
|
if value is None:
|
|
value = -1
|
|
return value
|
|
return _inner
|