Add durations utility for computing durations

This commit is contained in:
Evan Hahn 2021-08-26 09:10:58 -05:00 committed by GitHub
parent c6aa668a9b
commit f86f753df9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 99 additions and 95 deletions

View file

@ -30,6 +30,7 @@ import { z } from 'zod';
import Long from 'long';
import { assert, strictAssert } from '../util/assert';
import * as durations from '../util/durations';
import { getUserAgent } from '../util/getUserAgent';
import { toWebSafeBase64 } from '../util/webSafeBase64';
import { SocketStatus } from '../types/SocketStatus';
@ -266,7 +267,7 @@ function _validateResponse(response: any, schema: any) {
return true;
}
const FIVE_MINUTES = 1000 * 60 * 5;
const FIVE_MINUTES = 5 * durations.MINUTE;
type AgentCacheType = {
[name: string]: {