remove getSessionRequest

pull/1178/head
Audric Ackermann 5 years ago
parent 10e095ba9d
commit 4d2b08f4a2
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -270,34 +270,20 @@ export class SessionProtocol {
} }
} }
/**
* This is a utility function to avoid duplicate code between `getProcessedSessionRequest()` and `getSentSessionRequest()`
*/
private static async getSessionRequest(
device: string,
map: StringToNumberMap
): Promise<number | undefined> {
await SessionProtocol.fetchFromDBIfNeeded();
return map[device];
}
private static async getSentSessionRequest( private static async getSentSessionRequest(
device: string device: string
): Promise<number | undefined> { ): Promise<number | undefined> {
return SessionProtocol.getSessionRequest( await SessionProtocol.fetchFromDBIfNeeded();
device,
SessionProtocol.sentSessionsTimestamp return SessionProtocol.sentSessionsTimestamp[device];
);
} }
private static async getProcessedSessionRequest( private static async getProcessedSessionRequest(
device: string device: string
): Promise<number | undefined> { ): Promise<number | undefined> {
return SessionProtocol.getSessionRequest( await SessionProtocol.fetchFromDBIfNeeded();
device,
SessionProtocol.processedSessionsTimestamp return SessionProtocol.processedSessionsTimestamp[device];
);
} }
private static async hasAlreadySentSessionRequest( private static async hasAlreadySentSessionRequest(

Loading…
Cancel
Save