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.perform
will returnnil
- with variable
ENV['PM_SYNC_IN_DEV'] = 'true'
-
PackageMetadata::SyncWorker.new.perform
will start to execute- db transactions can be seen in console
-
log/application_json.log
hasDEBUG
entries fromPackageMetadata::SyncService
-
CTRL-C
to 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