Added cache Worker Manager to handle cache update #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



This pull request introduces a new worker-based system for scheduled cache updates in the
src/helpers/cachemodule. The main goal is to offload periodic cache refresh operations to a background worker thread, improving performance and reliability. The update includes the implementation of a worker manager, the worker itself, integration into the cache class, and new unit tests to verify the functionality.Worker-based scheduled cache updates:
CacheWorkerManagerclass (worker-manager.js) that manages a background worker thread for periodic cache updates, including event handling, status tracking, and error management.worker.js) that connects to the database, checks for domain updates at a configurable interval, and communicates with the main thread to synchronize cache state.Cacheclass (index.js), adding methods to start and stop scheduled updates, handle worker events, and synchronize cache versions between the worker and the main process. [1] [2]Testing and configuration:
cache.test.jsto verify scheduled cache updates, cache version synchronization, and worker lifecycle management. [1] [2] [3]