Expose process counter

This commit is contained in:
Daniel Lugo 2021-09-22 17:52:21 -04:00
parent 9cf8dddf1a
commit 762b704a5b
2 changed files with 9 additions and 2 deletions

View file

@ -237,7 +237,7 @@ const isReady = () =>
} }
}) })
let procID = 0 let procCounter = 0
let killed = false let killed = false
@ -245,7 +245,7 @@ const forge = async () => {
if (killed) { if (killed) {
throw new Error('Tried to forge after killing GunSmith') throw new Error('Tried to forge after killing GunSmith')
} }
logger.info(`Forging Gun # ${++procID}`) logger.info(`Forging Gun # ${++procCounter}`)
if (isForging) { if (isForging) {
throw new Error('Double forge?') throw new Error('Double forge?')
} }
@ -623,6 +623,9 @@ function createReplica(path, afterMap = false) {
} }
}) })
}) })
},
_getProcCounter() {
return procCounter
} }
} }
} }

View file

@ -39,6 +39,10 @@ namespace Smith {
* @throws * @throws
*/ */
pPut(data: GunT.ValidDataValue): Promise<void> pPut(data: GunT.ValidDataValue): Promise<void>
/**
* @protected
*/
_getProcCounter(): number
} }
export type UserSmithNode = GunSmithNode & GunT.UserGUNNode export type UserSmithNode = GunSmithNode & GunT.UserGUNNode