diff --git a/packages/cli/src/modules/insights/__tests__/insights.pre-init.test.ts b/packages/cli/src/modules/insights/__tests__/insights.pre-init.test.ts index 00031b7b6f..dcfc320758 100644 --- a/packages/cli/src/modules/insights/__tests__/insights.pre-init.test.ts +++ b/packages/cli/src/modules/insights/__tests__/insights.pre-init.test.ts @@ -10,21 +10,13 @@ describe('InsightsModulePreInit', () => { it('should return false if instance type is not "main"', () => { const ctx: ModulePreInitContext = { instance: mock({ instanceType: 'worker' }), - database: mock({ type: 'sqlite', sqlite: { poolSize: 10 } }), + database: mock({ type: 'sqlite' }), }; expect(shouldLoadModule(ctx)).toBe(false); }); - it('should return false if database type is "sqlite" and poolSize is < 1', () => { - const ctx: ModulePreInitContext = { - instance: mock({ instanceType: 'main' }), - database: mock({ type: 'sqlite', sqlite: { poolSize: 0 } }), - }; - expect(shouldLoadModule(ctx)).toBe(false); - }); - - it.each(['postgresdb', 'mariadb', 'mysqldb'])( - 'should return true if instance type is "main" and database is not sqlite', + it.each(['postgresdb', 'mariadb', 'mysqldb', 'sqlite'])( + 'should return true if instance type is "main"', (dbType: 'postgresdb' | 'mysqldb' | 'sqlite' | 'mariadb') => { const ctx: ModulePreInitContext = { instance: mock({ instanceType: 'main' }), @@ -33,12 +25,4 @@ describe('InsightsModulePreInit', () => { expect(shouldLoadModule(ctx)).toBe(true); }, ); - - it('should return true if instance type is "main" and sqlite poolSize is >= 1', () => { - const ctx: ModulePreInitContext = { - instance: mock({ instanceType: 'main' }), - database: mock({ type: 'sqlite', sqlite: { poolSize: 1 } }), - }; - expect(shouldLoadModule(ctx)).toBe(true); - }); }); diff --git a/packages/cli/src/modules/insights/insights.pre-init.ts b/packages/cli/src/modules/insights/insights.pre-init.ts index 040c1f8f25..b91be86e34 100644 --- a/packages/cli/src/modules/insights/insights.pre-init.ts +++ b/packages/cli/src/modules/insights/insights.pre-init.ts @@ -3,7 +3,4 @@ import type { ModulePreInitContext } from '../modules.config'; export const shouldLoadModule = (ctx: ModulePreInitContext) => // Only main instance(s) should collect insights // Because main instances are informed of all finished workflow executions, whatever the mode - ctx.instance.instanceType === 'main' && - // This is because legacy sqlite (without pool) does not support nested transactions needed for insights - // TODO: remove once benchmarks confirm this issue is solved with buffering / flushing mechanism - (ctx.database.type !== 'sqlite' || ctx.database.sqlite.poolSize > 0); + ctx.instance.instanceType === 'main';