mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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
|
// 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({
|
||||||
|
|
Loading…
Reference in a new issue