• celery 修改任务后 需要重启celery


    celery 修改任务后,需要重启,不然不生效:
    
    @task()
    def Task_A(message):
        now = datetime.datetime.now()
        return message+str(now)+'scan'
    
    node2:/celery/djtest#python manage.py celeryd -l info
    /usr/local/python27/lib/python2.7/site-packages/celery/platforms.py:812: RuntimeWarning: You are running the worker with superuser privileges, which is
    absolutely not recommended!
    
    Please specify a different user using the -u option.
    
    User information: uid=0 euid=0 gid=0 egid=0
    
      uid=uid, euid=euid, gid=gid, egid=egid,
     
     -------------- celery@node2 v3.1.25 (Cipater)
    ---- **** ----- 
    --- * ***  * -- Linux-2.6.32-431.el6.x86_64-x86_64-with-centos-6.5-Final
    -- * - **** --- 
    - ** ---------- [config]
    - ** ---------- .> app:         portal:0x2478490
    - ** ---------- .> transport:   redis://127.0.0.1:6379/0
    - ** ---------- .> results:     redis://127.0.0.1:6379/0
    - *** --- * --- .> concurrency: 1 (prefork)
    -- ******* ---- 
    --- ***** ----- [queues]
     -------------- .> celery           exchange=celery(direct) key=celery
                    
    
    [tasks]
      . djtest.celery.debug_task
      . portal.tasks.Task_A
    
    [2017-12-05 21:15:56,820: INFO/MainProcess] Connected to redis://127.0.0.1:6379/0
    [2017-12-05 21:15:56,830: INFO/MainProcess] mingle: searching for neighbors
    [2017-12-05 21:15:57,837: INFO/MainProcess] mingle: all alone
    [2017-12-05 21:15:57,852: WARNING/MainProcess] /usr/local/python27/lib/python2.7/site-packages/celery/fixups/django.py:265: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
      warnings.warn('Using settings.DEBUG leads to a memory leak, never '
    [2017-12-05 21:15:57,852: WARNING/MainProcess] celery@node2 ready.
    [2017-12-05 21:16:00,006: INFO/MainProcess] Received task: portal.tasks.Task_A[685cbe67-3efd-46db-ba53-199b9caa075a]
    [2017-12-05 21:16:00,011: INFO/MainProcess] Task portal.tasks.Task_A[685cbe67-3efd-46db-ba53-199b9caa075a] succeeded in 0.00437201800014s: u'aaa2017-12-05 21:16:00.007551scan'
    
    [2017-12-05 21:18:00,005: INFO/MainProcess] Received task: portal.tasks.Task_A[48b46f83-1fdf-4b89-bd54-1117b8a1736a]
    [2017-12-05 21:18:00,008: INFO/MainProcess] Task portal.tasks.Task_A[48b46f83-1fdf-4b89-bd54-1117b8a1736a] succeeded in 0.00170183199953s: u'aaa2017-12-05 21:18:00.006713scan'

  • 相关阅读:
    基于Python实现的死链接自动化检测工具
    MySQL 慢查询日志配置与简析
    Git 常用命令及操作总结
    redis redis常用命令及内存分析总结(附RedisClient工具简介
    Jenkins Jenkins结合GIT Maven持续集成环境配置
    JAVA TestNG单元测试详解
    MyEclipse TestNG插件安装与配置
    JAVA 利用MyEclipse结合TestNG测试框架进行单元测试
    lintcode :前序遍历和中序遍历树构造二叉树
    lintcode: 中序遍历和后序遍历树构造二叉树
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349390.html
Copyright © 2020-2023  润新知