zoukankan      html  css  js  c++  java
  • 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'

  • 相关阅读:
    TSQL(3)批处理
    TSQL(5)操作数据行
    如何设计数据库(1)?
    搜索引擎处理查询
    如何进行shell脚本正确性测试
    机房收费系统用户级别查询
    PageRank算法
    链接分析算法之:SALSA算法
    机器学习排序
    倒排索引搜索引擎的基石
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349390.html
Copyright © 2011-2022 走看看