In ash oban infer/bypass tenancy for action

Hello, I have a AshOban trigger that runs an update action. In the update action you cannot specify multitenancy :bypass so it errors out with changesets require a tenant to be specified this also if I'm specifying a read action that bypasses the tenancy. What is the best practice here allow global true in the multitenancy block?
3 Replies
barnabasj
barnabasj3mo ago
You could use global? true but there is also a list_tenants option for ash oban, that way it would run the scheduler for every tenant in the returned list
Marco Dell'Olio
Marco Dell'OlioOP3mo ago
ok, thanks. list_tenants is not a great option because it runs the same query x times
barnabasj
barnabasj3mo ago
with attribute based global is faster, with context you need list_tenants

Did you find this page helpful?