fix: Scheduler 用 slug 构建 tenant schema 名
tenant schema 是 it0_t_{slug}(如 it0_t_default),不是 it0_t_{uuid}。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
09274aa6af
commit
1c291ce6c0
|
|
@ -60,10 +60,10 @@ export class StandingOrderExecutorService implements OnModuleInit {
|
|||
*/
|
||||
@Cron('*/1 * * * *')
|
||||
async scanCronOrders(): Promise<void> {
|
||||
let tenants: { id: string; name: string }[];
|
||||
let tenants: { id: string; name: string; slug: string }[];
|
||||
try {
|
||||
const result = await this.dataSource.query(
|
||||
`SELECT id, name FROM public.tenants WHERE status = 'active'`,
|
||||
`SELECT id, name, slug FROM public.tenants WHERE status = 'active'`,
|
||||
);
|
||||
tenants = result;
|
||||
} catch (err) {
|
||||
|
|
@ -81,7 +81,7 @@ export class StandingOrderExecutorService implements OnModuleInit {
|
|||
tenantId: tenant.id,
|
||||
tenantName: tenant.name,
|
||||
plan: 'pro',
|
||||
schemaName: `it0_t_${tenant.id}`,
|
||||
schemaName: `it0_t_${tenant.slug}`,
|
||||
},
|
||||
async () => {
|
||||
const activeOrders =
|
||||
|
|
|
|||
Loading…
Reference in New Issue