- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试在 Google Compute Engine 上托管的
。Ubuntu 14.04
机器上的 rabbitmq
服务器支持的 Django 应用程序中配置 djcelery
尝试使用以下命令以 Debug模式启动 celery:python manage.py celery worker -B -E --loglevel=debug
,命令终止,输出如下:
[2016-03-24 12:16:09,568: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2016-03-24 12:16:09,571: DEBUG/MainProcess] | Worker: Building graph...
[2016-03-24 12:16:09,572: DEBUG/MainProcess] | Worker: New boot order: {Timer, Hub, Queues (intra), Pool, Autoscaler, StateDB, Autoreloader, Beat, Consumer}
[2016-03-24 12:16:09,575: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2016-03-24 12:16:09,576: DEBUG/MainProcess] | Consumer: Building graph...
[2016-03-24 12:16:09,577: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Mingle, Tasks, Control, Agent, Heart, Gossip, event loop}
<user>@<gce.host>:~/path/to/my/project$
此问题的可能原因是什么?在我的本地 ubuntu 机器上运行相同的设置,据我所知,我已经在我的云服务器上执行了所有步骤。
附加信息:我验证过的事情
=INFO REPORT==== 24-Mar-2016::17:02:14 === accepting AMQP connection <0.209.0> (127.0.0.1:42326 -> 127.0.0.1:5672)
=INFO REPORT==== 24-Mar-2016::17:02:14 === accepting AMQP connection <0.219.0> (127.0.0.1:42327 -> 127.0.0.1:5672)
=INFO REPORT==== 24-Mar-2016::17:02:17 === accepting AMQP connection <0.229.0> (127.0.0.1:42328 -> 127.0.0.1:5672)
5672
在我的机器上打开。我还打开了端口:tcp:5555
、tcp:4369
、tcp:15672
、tcp:5671
作为提到here (为了安全起见)。Celery在我项目中的配置:
安装了 celery
和 django-celery
包。创建了 rabbitMQ
用户并使用命令设置其权限:
sudo rabbitmqctl add_user <user> <password>
sudo rabbitmqctl set_permissions -p / <user> ".*" ".*" ".*"
在settings.py文件中,我添加了:
import djcelery
djcelery.setup_loader()
MIDDLEWARE_CLASSES = [ 'django.middleware.transaction.TransactionMiddleware',
..]
INSTALLED_APPS = ['djcelery',
..]
celery.py 的内容如下:
from __future__ import absolute_import
import os
from datetime import timedelta
from celery import Celery
from celery.schedules import crontab
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '<my_project>.settings')
app = Celery('<my_project>')
# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('<my_project>.settings')
# app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
app.conf.update(
CELERY_ACCEPT_CONTENT = ['json'],
CELERY_TASK_SERIALIZER = 'json',
CELERY_RESULT_SERIALIZER = 'json',
BROKER_URL = 'amqp://<user>:<password>@localhost:5672//',
# BROKER_URL = 'django://',
CELERY_RESULT_BACKEND = "amqp",
CELERY_IMPORTS = ("<module1>.tasks", "<module2>.tasks.tasks", "<module3>.tasks.tasks"),
CELERY_ALWAYS_EAGER = False,
# CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',
# CELERY_TIMEZONE = 'Europe/London'
CELERY_TIMEZONE = 'UTC',
CELERYBEAT_SCHEDULE = {
'debug-test': {
'task': '<module1>.tasks.test_celery',
'schedule': timedelta(seconds=5),
# 'args': (1, 2)
},
}
)
最佳答案
我终于解决了这个问题。我系统上的 celery
和 django-celery
包的版本不同。
ubuntu@my-host:~/path/to/project$ pip freeze | grep celery
celery==3.1.21
django-celery==3.1.17
将 celery 版本更改为 3.1.17
修复了它。要更改 pip
的包版本,请使用:
ubuntu@my-host:~/path/to/project$ sudo pip install -I celery==3.1.17
关于python - Django:Celery Worker 没有开始(没有任何错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36206825/
如果一个域有多个团队和多个 Web 应用程序,那么注册 Service Worker 来管理整个站点的最佳建议是什么?具有范围的顶级服务 worker /或子域中的多个服务 worker ?由于一个域
我开发了一个应用程序来分析播放 YouTube 视频时的网络流量。它使用 chrome.webRequest,我使用 onHeadersReceived 事件计算流量。 我想使用 service wo
假设我提供了不同网站使用的推送通知服务。此服务需要在我的客户站点上安装服务 worker 。我希望架构具有一些属性: 完全静态资源。安装service worker文件和配置JS片段等过程只需要完成一
我要缓存某人网站中的特定请求 ,那么我发现 service worker 是一个不错的选择。但我找不到任何方法 通过 tampermonkey 注入(inject)一个 service worker
当 Service Worker 更新时,它不会以正确的方式控制页面;它进入“等待”状态,等待被激活。 令人惊讶的是,更新后的 Service Worker 甚至在刷新页面后都无法控制选项卡。谷歌解释
有谁知道是否有办法在 service worker 中获取此号码或日期: 将我的服务 worker 缓存命名为 cache-1182 会很方便或 cache-20171127171448 我想在安装事
这link说: Workers may spawn more workers if they wish. So-called sub-workers must be hosted within the
有许多关于使用 ngsw-worker.js 安装 ServiceWorker 的分步指南;然而,甚至没有关于使用 safety-worker.js 卸载 ServiceWorker 的分步指南。 s
我正在尝试为我的网站使用后台定期同步。我正在使用 localhost 并在 1*1000 毫秒时注册 periodicsync 事件,但这根本不会触发。 我看过这个demo ,但即使我将该网站安装为应
我试图让用户安排一个周期性任务。我还在一个容器中运行多个 celery worker 。我对该容器的命令过去是这样的: celery worker -c 4 -B -l INFO -A my.cele
从我所看到的,你甚至可以缓存一个网页。根据此文档:https://www.mnot.net/cache_docs/#BROWSER ,表示可以缓存在浏览器缓存中。我看到即使是 serviceworke
我只是在测试 Service Worker 的功能以了解其工作原理。所以现在我遇到了一个问题。 var CACHE_NAME = 'my-site-cache-v1'; var urlsToCache
下图显示安装了两名工作人员 - 一名处于事件状态,另一名未处于事件状态(刚刚安装)。 注册 service worker 更改 service-worker.js并重新加载页面。 逻辑是 Servic
我正在尝试学习渐进式 Web 应用程序的一些基础知识,并且在我阅读的其中一篇教程中学习 [在安装了 service worker 并且用户导航到不同的页面或刷新后,service worker 将开始
我正在开发一个应用程序,其目标是定期(例如每小时)向用户发送通知。 我的想法是使用一个可以在选项卡关闭后运行的服务 worker ,并继续向用户发送这些通知。 网页需要能够与 Service Work
我正在尝试为一个简单但旧的 Django Web 应用程序安装 ServiceWorker。我开始使用示例 read-through caching example from the Chrome t
在我们开发的情况下,我们提供来自 https://localhost 的文件因为该应用程序托管在 salesforce.com 中。在 chrome service worker 中,chrome 会
我是服务人员的新手,并且浏览了各种文档(Google,Mozilla,serviceworke.rs,Github,StackOverflow questions)。最有用的是ServiceWorke
我正在解决一个问题,我有一组“热情的 worker ”。这意味着它们被维护在内存中,维护自己的上下文并且是可调用的。我一直在研究各种 Go Worker 实现,但都依赖于闭包或返回结果的简单计算函数。
我有一个部署到静态服务器的非根路径的网络应用程序。即MyApp构建时部署到路径/文件夹 https://example.com/myapp . MyApp正在使用 vue 和 webpack 所以我添
我是一名优秀的程序员,十分优秀!