Created
February 11, 2020 08:26
-
-
Save volgoweb/17229b73c9ec470f8493ffc2abb21932 to your computer and use it in GitHub Desktop.
Find a mistake in celery task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################# | |
# Find a mistake: | |
################# | |
from django.core.cache import cache | |
from celery import shared_task | |
@shared_task() | |
def clear_blog_item_cache(article): | |
cache_key = 'blog_item_%d' % article.pk | |
cache.delete(cache_key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment