kubeshop / vscode-monokle

An extension for Visual Studio Code to validate your Kubernetes configuration
https://marketplace.visualstudio.com/items?itemName=kubeshop.monokle
MIT License
6 stars 0 forks source link

Policy sync interval seems odd #76

Closed f1ames closed 6 months ago

f1ames commented 8 months ago

Policy syncing interval is set to 30 seconds:

https://github.com/kubeshop/vscode-monokle/blob/8964cc2fe5726576d8e3d73aff3c6682bf7d1e74/src/utils/policy-puller.ts#L10

https://github.com/kubeshop/vscode-monokle/blob/8964cc2fe5726576d8e3d73aff3c6682bf7d1e74/src/utils/policy-puller.ts#L44-L68

However, @WitoDelnat observed on his machine (macOS, M1 AFAIR) that it basically syncs all the time (like every 5 seconds). This needs to be checked whats going on.

f1ames commented 6 months ago

Found the cause when working on https://github.com/kubeshop/monokle-saas/issues/2307 and fixed in #92.

There was a bug (looked like kind of leftover / not fully cleaned-up code), where synchronization would fire synchronize event. The synchronize event listener would again restart synchronization procedure... creating a loop 😓

https://github.com/kubeshop/vscode-monokle/blob/6cf6de4bd00d5c2d0f374a4024190cd586d5faf5/src/extension.ts#L307-L316