1
0
Эх сурвалжийг харах

fix(core): Fix scheduled task registration to avoid entity ID errors (#3763)

gabriellbui 4 сар өмнө
parent
commit
68e98ebea8

+ 3 - 0
packages/core/src/plugin/default-scheduler-plugin/default-scheduler-strategy.ts

@@ -241,6 +241,9 @@ export class DefaultSchedulerStrategy implements SchedulerStrategy {
                 .insert()
                 .into(ScheduledTaskRecord)
                 .values({ taskId })
+                // Fix for versions lower than MariaDB v10.5 and MySQL: updateEntity(false) prevents TypeORM from
+                // using the RETURNING clause after an INSERT. Keep in mind that this query won't return the id of the inserted record.
+                .updateEntity(false)
                 .orIgnore()
                 .execute();