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 * * * *')
|
@Cron('*/1 * * * *')
|
||||||
async scanCronOrders(): Promise<void> {
|
async scanCronOrders(): Promise<void> {
|
||||||
let tenants: { id: string; name: string }[];
|
let tenants: { id: string; name: string; slug: string }[];
|
||||||
try {
|
try {
|
||||||
const result = await this.dataSource.query(
|
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;
|
tenants = result;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -81,7 +81,7 @@ export class StandingOrderExecutorService implements OnModuleInit {
|
||||||
tenantId: tenant.id,
|
tenantId: tenant.id,
|
||||||
tenantName: tenant.name,
|
tenantName: tenant.name,
|
||||||
plan: 'pro',
|
plan: 'pro',
|
||||||
schemaName: `it0_t_${tenant.id}`,
|
schemaName: `it0_t_${tenant.slug}`,
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
const activeOrders =
|
const activeOrders =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue