check is id

This commit is contained in:
virusdefender
2019-03-26 09:33:05 +08:00
parent 7e4132bed1
commit 6f8e68846c
2 changed files with 9 additions and 2 deletions

View File

@@ -85,3 +85,10 @@ def get_env(name, default=""):
def DRAMATIQ_WORKER_ARGS(time_limit=3600_000, max_retries=0, max_age=7200_000):
return {"max_retries": max_retries, "time_limit": time_limit, "max_age": max_age}
def check_is_id(value):
try:
return int(value) > 0
except Exception as e:
return False