Skip to content

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 return nil
  • 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 has DEBUG entries from PackageMetadata::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.

Edited by Adam Cohen

Merge request reports

Loading