madecoste / swarming

Automatically exported from code.google.com/p/swarming
Apache License 2.0
0 stars 1 forks source link

Extract GlobalConfig into a separate component #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Basically 'config' component should provide:

1. Base class (or equivalent) for GlobalConfig singleton entity.
2. 'fetch', 'store' and 'modify' methods.
3. In-memory cache, bootstrap of default config, e.g.

@utils.cache_with_expiration(expiration_sec=60)
def config():
  """Returns GlobalConfig object with global configuration."""
  ...

4. [stretch] Autogenerated HTML page to modify it. Or maybe Cloud Endpoint  API 
to read and modify config (API Explorer UI is beta' than nothing).

Implementation wise it should use datastore_utils.get_versioned_root_model.

----

GlobalConfig "pattern" is reimplemented in Swarming service, Isolate service 
and a bunch of other services in infra.git. Makes sense to reduce copy-pasta.

Original issue reported on code.google.com by vadimsh@chromium.org on 17 Dec 2014 at 11:25

GoogleCodeExporter commented 9 years ago

Original comment by vadimsh@chromium.org on 18 Dec 2014 at 11:45

GoogleCodeExporter commented 9 years ago
When you start using it, please paste a link to a commit here, so it can be 
used as an example.

Original comment by no...@chromium.org on 19 Dec 2014 at 1:50