mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Do not attempt to save statistics data for unsaved workflows (#5106)
* fix: Do not attempt to save data for unsaved workflows
This commit is contained in:
@@ -24,7 +24,7 @@ export async function workflowExecutionCompleted(
|
|||||||
|
|
||||||
// Get the workflow id
|
// Get the workflow id
|
||||||
const workflowId = workflowData.id;
|
const workflowId = workflowData.id;
|
||||||
if (workflowId === undefined) return;
|
if (!workflowId) return;
|
||||||
|
|
||||||
// Try insertion and if it fails due to key conflicts then update the existing entry instead
|
// Try insertion and if it fails due to key conflicts then update the existing entry instead
|
||||||
try {
|
try {
|
||||||
@@ -59,7 +59,11 @@ export async function workflowExecutionCompleted(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function nodeFetchedData(workflowId: string, node: INode): Promise<void> {
|
export async function nodeFetchedData(
|
||||||
|
workflowId: string | undefined | null,
|
||||||
|
node: INode,
|
||||||
|
): Promise<void> {
|
||||||
|
if (!workflowId) return;
|
||||||
// Try to insert the data loaded statistic
|
// Try to insert the data loaded statistic
|
||||||
try {
|
try {
|
||||||
await Db.collections.WorkflowStatistics.insert({
|
await Db.collections.WorkflowStatistics.insert({
|
||||||
|
|||||||
Reference in New Issue
Block a user