mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08: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:
parent
47e32e4268
commit
a43e3e4112
|
@ -24,7 +24,7 @@ export async function workflowExecutionCompleted(
|
|||
|
||||
// Get the workflow 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 {
|
||||
|
@ -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 {
|
||||
await Db.collections.WorkflowStatistics.insert({
|
||||
|
|
Loading…
Reference in a new issue