1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Improve logging

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen 2021-11-22 15:38:06 +02:00
parent 2f478f1b9d
commit 8b112009ac
No known key found for this signature in database
GPG Key ID: 54B44603D251B788

View File

@ -594,12 +594,14 @@ export class KubeApi<T extends KubeObject> {
}
electron.powerMonitor.once("resume", () => {
clearTimeout(timedRetry);
logger.info(`[KUBE-API] system resumed, resume watching of ${watchUrl}...`);
timedRetry = setTimeout(() => {
if (this.networkOnline) {
logger.info(`[KUBE-API] system resumed, resume watching of ${watchUrl}...`);
this.watch({ ...opts, namespace, callback, watchId, retry: true });
} else {
logger.info(`[KUBE-API] system resumed but network appears to be offline, resume watching when online.`);
electron.ipcMain.once("network:online", () => {
logger.info(`[KUBE-API] network on line, resume watching of ${watchUrl}...`);
this.watch({ ...opts, namespace, callback, watchId, retry: true });
});
}