Improve logging

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen committed 2021-11-23 09:22:44 +02:00
1 parent 2f478f1b9d
commit 8b112009ac
1 file changed
+3 -1
+3 -1
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 });
});
}