Run package metadata conditionally in dev
What does this MR do and why?
Because package metadata sync can be resource intensive, this MR turns sync off by default when the rails environment is development.
The feature can be turned back on by setting the PM_SYNC_IN_DEV flag to true.
How to set up and validate locally
In bundle exec rails console:
- without the variable
PackageMetadata::SyncWorker.new.performwill returnnil - with variable
ENV['PM_SYNC_IN_DEV'] = 'true'-
PackageMetadata::SyncWorker.new.performwill start to execute- db transactions can be seen in console
-
log/application_json.loghasDEBUGentries fromPackageMetadata::SyncService
-
CTRL-Cto exit
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Adam Cohen