fix: Set '@typescript-eslint/return-await' rule to 'always' for node code (no-changelog) (#8363)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Tomi Turtiainen
2024-01-17 17:08:50 +02:00
committed by GitHub
parent 2eb829a6b4
commit 9a1cc56806
369 changed files with 1041 additions and 928 deletions

View File

@@ -20,7 +20,7 @@ export class UniqueWorkflowNames1620821879465 implements ReversibleMigration {
await Promise.all(
duplicates.map(async (workflow, index) => {
if (index === 0) return;
return runQuery(`UPDATE ${tableName} SET name = :name WHERE id = :id`, {
return await runQuery(`UPDATE ${tableName} SET name = :name WHERE id = :id`, {
name: `${workflow.name} ${index + 1}`,
id: workflow.id,
});

View File

@@ -26,11 +26,12 @@ export class AddJsonKeyPinData1659888469333 implements IrreversibleMigration {
const selectQuery = `SELECT id, ${columnName} FROM ${tableName} WHERE ${columnName} IS NOT NULL`;
await runInBatches<Workflow>(selectQuery, async (workflows) => {
await Promise.all(
this.makeUpdateParams(workflows).map(async (workflow) =>
runQuery(`UPDATE ${tableName} SET ${columnName} = :pinData WHERE id = :id;`, {
pinData: workflow.pinData,
id: workflow.id,
}),
this.makeUpdateParams(workflows).map(
async (workflow) =>
await runQuery(`UPDATE ${tableName} SET ${columnName} = :pinData WHERE id = :id;`, {
pinData: workflow.pinData,
id: workflow.id,
}),
),
);
});

View File

@@ -18,13 +18,13 @@ export class RemoveWorkflowDataLoadedFlag1671726148419 implements ReversibleMigr
await Promise.all(
workflowIds.map(
async ({ id, dataLoaded }) =>
dataLoaded &&
runQuery(
`INSERT INTO ${statisticsTableName}
await (dataLoaded &&
runQuery(
`INSERT INTO ${statisticsTableName}
(${escape.columnName('workflowId')}, name, count, ${escape.columnName('latestEvent')})
VALUES (:id, :name, 1, ${now})`,
{ id, name: StatisticsNames.dataLoaded },
),
{ id, name: StatisticsNames.dataLoaded },
)),
),
);
@@ -47,10 +47,11 @@ export class RemoveWorkflowDataLoadedFlag1671726148419 implements ReversibleMigr
);
await Promise.all(
workflowsIds.map(async ({ workflowId }) =>
runQuery(`UPDATE ${workflowTableName} SET ${columnName} = true WHERE id = :id`, {
id: workflowId,
}),
workflowsIds.map(
async ({ workflowId }) =>
await runQuery(`UPDATE ${workflowTableName} SET ${columnName} = true WHERE id = :id`, {
id: workflowId,
}),
),
);

View File

@@ -47,10 +47,13 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements Irreversibl
});
// Update database with new connections
return runQuery(`UPDATE ${workflowsTable} SET connections = :connections WHERE id = :id`, {
connections: JSON.stringify(connections),
id: workflow.id,
});
return await runQuery(
`UPDATE ${workflowsTable} SET connections = :connections WHERE id = :id`,
{
connections: JSON.stringify(connections),
id: workflow.id,
},
);
}),
);
}

View File

@@ -18,15 +18,15 @@ export class AddUserActivatedProperty1681134145996 implements ReversibleMigratio
AND r.scope = 'workflow'`,
)) as UserSettings[];
const updatedUsers = activatedUsers.map(async (user) =>
queryRunner.query(
const updatedUserPromises = activatedUsers.map(async (user) => {
await queryRunner.query(
`UPDATE "${tablePrefix}user" SET settings = '${JSON.stringify(
user.settings,
)}' WHERE id = '${user.id}' `,
),
);
);
});
await Promise.all(updatedUsers);
await Promise.all(updatedUserPromises);
if (!activatedUsers.length) {
await queryRunner.query(

View File

@@ -18,14 +18,14 @@ export class AddUserActivatedProperty1681134145996 implements ReversibleMigratio
AND r.scope = "workflow"`,
)) as UserSettings[];
const updatedUsers = activatedUsers.map(async (user) =>
queryRunner.query(
const updatedUserPromises = activatedUsers.map(async (user) => {
await queryRunner.query(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`UPDATE ${tablePrefix}user SET settings = '${user.settings}' WHERE id = '${user.id}' `,
),
);
);
});
await Promise.all(updatedUsers);
await Promise.all(updatedUserPromises);
if (!activatedUsers.length) {
await queryRunner.query(