So i have Django 2.2.6 psycopg2-binary===2.8.6 and python version 3.9.7 and when my celery task is getting executed I want to set tenant so for that i am querying in Client table and intermittently i am not able to find data in DB even tough data exist in my db what should i do
Write a wrapper around running your celery tasks, store the schema_name / tenant for which the task must run and run your task within a with schema_context(schema_name) context.
So i have Django 2.2.6 psycopg2-binary===2.8.6 and python version 3.9.7 and when my celery task is getting executed I want to set tenant so for that i am querying in Client table and intermittently i am not able to find data in DB even tough data exist in my db what should i do