Ask Solem 10 年之前
父節點
當前提交
9a369b4954
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      docs/tutorials/task-cookbook.rst

+ 2 - 2
docs/tutorials/task-cookbook.rst

@@ -38,8 +38,8 @@ The cache key expires after some time in case something unexpected happens
 
     LOCK_EXPIRE = 60 * 5 # Lock expires in 5 minutes
 
-    @task
-    def import_feed(feed_url):
+    @task(bind=True)
+    def import_feed(self, feed_url):
         # The cache key consists of the task name and the MD5 digest
         # of the feed URL.
         feed_url_digest = md5(feed_url).hexdigest()