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(
device: string
): Promise<number | undefined> {
return SessionProtocol.getSessionRequest(
device,
SessionProtocol.sentSessionsTimestamp
);
await SessionProtocol.fetchFromDBIfNeeded();
return SessionProtocol.sentSessionsTimestamp[device];
}
private static async getProcessedSessionRequest(
device: string
): Promise<number | undefined> {
return SessionProtocol.getSessionRequest(
device,
SessionProtocol.processedSessionsTimestamp
);
await SessionProtocol.fetchFromDBIfNeeded();
return SessionProtocol.processedSessionsTimestamp[device];
}
private static async hasAlreadySentSessionRequest(

Loading…
Cancel
Save