Use ternary with await for consistent style and better stack traces
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
+3
-4
@@ -92,10 +92,9 @@ export async function getDeferredStitchableEntities(options: {
|
||||
}));
|
||||
};
|
||||
|
||||
if (knex.isTransaction || !useLocking) {
|
||||
return run(knex);
|
||||
}
|
||||
return knex.transaction(run);
|
||||
return knex.isTransaction || !useLocking
|
||||
? await run(knex)
|
||||
: await knex.transaction(run);
|
||||
}
|
||||
|
||||
function nowPlus(knex: Knex, duration: HumanDuration): Knex.Raw {
|
||||
|
||||
Reference in New Issue
Block a user