Browse Source

Fix typo.

There is no `self` in the context, `__name__` seems reasonable.
flyingfoxlee 10 năm trước cách đây
mục cha
commit
e4a8419046
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      docs/tutorials/task-cookbook.rst

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

@@ -43,7 +43,7 @@ The cache key expires after some time in case something unexpected happens
         # The cache key consists of the task name and the MD5 digest
         # of the feed URL.
         feed_url_digest = md5(feed_url).hexdigest()
-        lock_id = '{0}-lock-{1}'.format(self.name, feed_url_hexdigest)
+        lock_id = '{0}-lock-{1}'.format(__name__, feed_url_hexdigest)
 
         # cache.add fails if the key already exists
         acquire_lock = lambda: cache.add(lock_id, 'true', LOCK_EXPIRE)