Skip to content

Commit

Permalink
api: rename refresh_timeout option to operation_timeout
Browse files Browse the repository at this point in the history
This timeout is going to be used as a more general timeout for operations that
the API needs to do and that block for a long time.
  • Loading branch information
jd committed Nov 13, 2017
1 parent c591b84 commit e8221ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions gnocchi/opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ def list_opts():
required=True,
help=('The maximum number of items returned in a '
'single response from a collection resource')),
cfg.IntOpt('refresh_timeout',
cfg.IntOpt('operation_timeout',
deprecated_name="refresh_timeout",
default=10, min=0,
help='Number of seconds before timeout when attempting '
'to force refresh of metric.'),
'to do some operations.'),
) + API_OPTS,
),
("storage", _STORAGE_OPTS),
Expand Down
4 changes: 2 additions & 2 deletions gnocchi/rest/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def get_measures(self, start=None, stop=None, aggregation='mean',
try:
pecan.request.storage.refresh_metric(
pecan.request.indexer, pecan.request.incoming, self.metric,
pecan.request.conf.api.refresh_timeout)
pecan.request.conf.api.operation_timeout)
except storage.SackLockTimeoutError as e:
abort(503, six.text_type(e))
try:
Expand Down Expand Up @@ -1790,7 +1790,7 @@ def get_cross_metric_measures_from_objs(metrics, start=None, stop=None,
try:
pecan.request.storage.refresh_metric(
pecan.request.indexer, pecan.request.incoming, m,
pecan.request.conf.api.refresh_timeout)
pecan.request.conf.api.operation_timeout)
except storage.SackLockTimeoutError as e:
abort(503, six.text_type(e))
if number_of_metrics == 1:
Expand Down

0 comments on commit e8221ef

Please sign in to comment.