feat(core): Add unique id to instances (#6863)
* add serverId and workerId * adjust id format * fix logger init / test * update implementation
This commit is contained in:
committed by
GitHub
parent
f038e1e9a6
commit
6499f42481
@@ -1,6 +1,12 @@
|
||||
import { customAlphabet } from 'nanoid';
|
||||
import type { N8nInstanceType } from '@/Interfaces';
|
||||
|
||||
const nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 16);
|
||||
|
||||
export function generateNanoId() {
|
||||
return nanoid();
|
||||
}
|
||||
|
||||
export function generateHostInstanceId(instanceType: N8nInstanceType) {
|
||||
return `${instanceType}-${nanoid()}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user