Skip to content

Instantly share code, notes, and snippets.

@jsam
Created May 17, 2023 09:53
Show Gist options
  • Save jsam/bbb6aefb8f17d145936156fdc897b390 to your computer and use it in GitHub Desktop.
Save jsam/bbb6aefb8f17d145936156fdc897b390 to your computer and use it in GitHub Desktop.
Sanin example
def test_enqueue_geohash_fetch(redis_conn):
enqueue_geohash_fetch()
# NOTE: provjeris ovjde da li je job enqueuan na zadanom queue i ima odgovarajuce parametrom
redis_conn.get("___")
@task
def enqueue_geohash_fetch():
"""Enqueues retrieval job for each tenant every N hours."""
qs = Client.objects.exclude(tenant_name__startwith="demo_").all()
for client in qs:
import_geohash.delay(client)
@task
def import_geohash(tenant_name, ...):
"""Get geohash for a tenant."""
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment