MCPcopy
hub / github.com/chartbrew/chartbrew / getDurationMs

Function getDurationMs

server/modules/updateAudit.js:254–263  ·  view source on GitHub ↗
(startedAt, finishedAt)

Source from the content-addressed store, hash-verified

252}
253
254function getDurationMs(startedAt, finishedAt) {
255 const normalizedStartedAt = hydrateDate(startedAt);
256 const normalizedFinishedAt = hydrateDate(finishedAt);
257
258 if (!normalizedStartedAt || !normalizedFinishedAt) {
259 return null;
260 }
261
262 return Math.max(0, normalizedFinishedAt.getTime() - normalizedStartedAt.getTime());
263}
264
265function emitStructuredAuditLog(action, payload) {
266 return { action, payload };

Callers 3

finishEventFunction · 0.85
completeRunFunction · 0.85
failRunFunction · 0.85

Calls 1

hydrateDateFunction · 0.85

Tested by

no test coverage detected