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:
parent
2f478f1b9d
commit
8b112009ac
@ -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 });
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user