From 762b704a5b2bad08f8e794a8cfd4a23efc969f5e Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Wed, 22 Sep 2021 17:52:21 -0400 Subject: [PATCH] Expose process counter --- utils/GunSmith/GunSmith.js | 7 +++++-- utils/GunSmith/Smith.ts | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/GunSmith/GunSmith.js b/utils/GunSmith/GunSmith.js index 6615b8f8..d2fdb9b2 100644 --- a/utils/GunSmith/GunSmith.js +++ b/utils/GunSmith/GunSmith.js @@ -237,7 +237,7 @@ const isReady = () => } }) -let procID = 0 +let procCounter = 0 let killed = false @@ -245,7 +245,7 @@ const forge = async () => { if (killed) { throw new Error('Tried to forge after killing GunSmith') } - logger.info(`Forging Gun # ${++procID}`) + logger.info(`Forging Gun # ${++procCounter}`) if (isForging) { throw new Error('Double forge?') } @@ -623,6 +623,9 @@ function createReplica(path, afterMap = false) { } }) }) + }, + _getProcCounter() { + return procCounter } } } diff --git a/utils/GunSmith/Smith.ts b/utils/GunSmith/Smith.ts index e8d0af0d..46bec601 100644 --- a/utils/GunSmith/Smith.ts +++ b/utils/GunSmith/Smith.ts @@ -39,6 +39,10 @@ namespace Smith { * @throws */ pPut(data: GunT.ValidDataValue): Promise + /** + * @protected + */ + _getProcCounter(): number } export type UserSmithNode = GunSmithNode & GunT.UserGUNNode