samvera / valkyrie

A Data Mapper library to enable multiple backends for storage of files and metadata in Samvera
Other
34 stars 23 forks source link

Raise error when configured adapter is missing #426

Open awead opened 6 years ago

awead commented 6 years ago

I can assign bogus adapters in config/valkyrie.yml:

production:
  metadata_adapter: postgres
  storage_adapter: bogus

Things will move along fine until that adapter is actually called. Maybe we can raise an error early on and prevent the app from starting up. This could catch misconfigured adapters before things make it out to production.

afred commented 4 years ago

@awead we're lookin into this... and we think it represents a bit of a race condition. It would be very hard to front load the checking of the config file at initialization time in order to guarantee that there has been -- or more importantly will be -- a registered adapter.

I.e. you might have initializers (or other code elsewhere) that registers adapter bogus at some indeterminate time after config is initially read and loaded, so determining whether bogus is legit or not is hard to do when the app is initializing.