2012-04-18 66 views
1

我想用django-utils以並行線程(這些命令在I/O上處理99.99%)異步啓動大量命令。不過,我不斷收到以下錯誤:djutils隊列命令沒有被發現

QueueException: MyProject.maintenanceInterface.commands.queuecmd_refreshDataAsync not found in CommandRegistry 

功能refreshDataAsync是commands.py內maintenanceInterface - 和maintenanceInterface是在安裝的應用程序列表。

我正在排隊的消費者,像這樣:

python .\manage.py queue_consumer 

當我看着排隊的消費者日誌,它會告訴我,它已經發現的功能(在INIT):

djutils.commands.queuecmd_delayed_resize 
djutils.queue.queue.QueueCommand 
djutils.queue.queue.PeriodicQueueCommand 
maintenanceInterface.commands.queuecmd_refreshDataAsync 
2012-04-18 16:57:10,598:djutils.queue.logger:INFO:Starting periodic command execution thread 

仍然拋出異常。

我錯過了某個步驟?

回答

1

不是一個簡單的答案,但確實是一個很好的建議,只需使用芹菜和django芹菜來做這個異步處理。

你可以用django-utils(至少在異步方面)和更多(大量後端,你可以命名的任何設置/參數)來完成你所有的工作,也有很少的相關項目使用芹菜做異步事情(例如,你想發送電子郵件使用芹菜你寫0行代碼,有一個應用程序)

+0

該系統的下一個版本將使用芹菜。 – Goro 2012-04-19 18:52:26

0

問題是,消費者導入相同的庫作爲Django的代碼庫 - 但路徑略有不同。

消費者被導入

maintenanceInterface.commands.queuecmd_refreshDataAsync 

和代碼是顯式調用它上面的包:

WepPlatform.maintenanceInterface.commands.refreshDataAsync 

所以消費者無法匹配,不會運行命令。