zoukankan      html  css  js  c++  java
  • celery笔记

    安装:pip install celery==4.1.0(django==1.11, redis==2.10.6, django-redis==4.4.0, kombu==4.1.0)
    执行异步任务命令(二选一):
    celery -A celery_task.task worker --pool=solo -l info
    celery -A celery_task.task worker -l info

    执行定时任务命令(需要登录后台管理页面添加任务):
    celery -A celery_task.task worker -l info

    保存结果需安装:django-celery-results==1.0.4

    Issues with mysql
    If you want to run django-celery-results with MySQL, you might run into some issues.

    One such issue is when you try to run python manage.py migrate django_celery_results, you might get the following error:

    django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes')
    To get around this issue, you can set:

    DJANGO_CELERY_RESULTS_TASK_ID_MAX_LENGTH=191
    (or any other value if any other db other than MySQL is causing similar issues.)

    max_length of 191 seems to work for MySQL.

    window开启mysql远程访问方法:
    1、放通3306端口,防火墙添加入站规则
    2、user表127.0.0.1改为%
    3、flush privileges;

    mysql设置时区:set global time_zone = '+8:00';

  • 相关阅读:
    Wireshark下载地址
    WireShark过滤语法
    Centos7 虚拟机安装增强功能
    更改切换热键
    kali安装后中文乱码
    C#中关于WebBrowser的一些细节设置
    方法间多参数传递
    绑定checkedComboBox
    反射方法调用例子
    gridView 删除一行后自动定位到指定行
  • 原文地址:https://www.cnblogs.com/Fmaj7/p/12220689.html
Copyright © 2011-2022 走看看