~bac/charms/precise/charmworld/trunk

« back to all changes in this revision

Viewing changes to scripts/write_config.py

  • Committer: Brad Crittenden
  • Date: 2014-01-02 21:17:51 UTC
  • mfrom: (86.1.1 remove-queue-cronjob)
  • Revision ID: bac@canonical.com-20140102211751-23jn69egsyew3x3f
[r=benji] Remove queue cronjob entry.  Rename config execute-ingest-every to cron-interval.  Add separate script-lease-time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    handler_class, handler_args = error_handler
32
32
    new_config.set('handler_exc_smtp', 'class', handler_class)
33
33
    new_config.set('handler_exc_smtp', 'args', handler_args)
34
 
    # script_lease_time specifies the time for which the scripts
35
 
    # "queue" and "review" hold their locks. Set to twice the time
36
 
    # interval execute-ingest-every, plus 1 minute slack to address
37
 
    # a possible clock skew between two instances.
38
 
    ingest_cycle = config()['execute-ingest-every']
39
 
    if ingest_cycle < 5:
40
 
        ingest_cycle = 5
41
 
    if ingest_cycle > 60:
42
 
        ingest_cycle = 60
 
34
    # script_lease_time specifies the time for which scripts
 
35
    # (e.g. askubuntu, github, and review, ) hold their locks before timing
 
36
    # out.
 
37
    script_lease_time = config()['script-lease-time']
 
38
    if script_lease_time < 5:
 
39
        script_lease_time = 5
 
40
    if script_lease_time > 60:
 
41
        script_lease_time = 60
43
42
    new_config.set(
44
 
        'app:main', 'script_lease_time', ingest_cycle)
 
43
        'app:main', 'script_lease_time', script_lease_time)
45
44
    new_config.set(
46
45
        'app:main', 'worker_interval', worker_interval)
47
46
    new_config.set('app:main', 'es_replicas', es_replicas)