diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-08-10 10:38:30 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2016-08-10 10:55:18 +0100 |
commit | 9476ef9c910a39e54dea2b64064b6057ab5477cd (patch) | |
tree | 6f45e3a13042a1e929be451e24686883f6b4e42d /perllib/FixMyStreet/App/Controller | |
parent | ba55ebdb6fa87f7772a539a139bef0a16879d757 (diff) |
Add config for Open311 request limit, default 1000.
Fixes #1313.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Open311.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm index 4f1727b1a..98e5f42b2 100644 --- a/perllib/FixMyStreet/App/Controller/Open311.pm +++ b/perllib/FixMyStreet/App/Controller/Open311.pm @@ -112,7 +112,7 @@ sub get_discovery : Private { 'changeset' => [$prod_changeset], # XXX rewrite to match 'key_service' => ["Read access is open to all according to our \u003Ca href='/open_data' target='_blank'\u003Eopen data license\u003C/a\u003E. For write access either: 1. return the 'guid' cookie on each call (unique to each client) or 2. use an api key from a user account which can be generated here: http://seeclickfix.com/register The unversioned url will always point to the latest supported version."], - 'max_requests' => [ $c->config->{RSS_LIMIT} ], + 'max_requests' => [ $c->config->{OPEN311_LIMIT} || 1000 ], 'endpoints' => [ { 'endpoint' => [ @@ -205,8 +205,9 @@ sub get_services : Private { sub output_requests : Private { my ( $self, $c, $criteria, $limit ) = @_; - $limit = $c->config->{RSS_LIMIT} - unless $limit && $limit <= $c->config->{RSS_LIMIT}; + my $default_limit = $c->config->{OPEN311_LIMIT} || 1000; + $limit = $default_limit + unless $limit && $limit <= $default_limit; my $attr = { order_by => { -desc => 'confirmed' }, |