diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-12-13 18:03:17 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-12-13 18:24:28 +0100 |
commit | 0bf442113c50ff3f7d304e18411791f84cb8f53e (patch) | |
tree | 746eb2750db539e5c0db8042e354a08286e58a14 /app | |
parent | f59b78503c3e6ee39d13a0b1a959784cccca5da6 (diff) | |
download | ecs2-0bf442113c50ff3f7d304e18411791f84cb8f53e.tar.gz ecs2-0bf442113c50ff3f7d304e18411791f84cb8f53e.zip |
/sys/events/fifo provides now count query parameter.
Now you can call
curl .... -X POST https://server/sys/events/fifo?count=10
which returns a list of max. 10 events and concurrently deletes them
server side.
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/events_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 4c8a37a..1e8ec1d 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -36,7 +36,8 @@ class EventsController < ApplicationController max_tries = 5 begin Event.transaction do - events_render(@participant.id, 1) + count = params["count"].blank? ? 1 : params["count"].to_i + events_render(@participant.id, count) end rescue ActiveRecord::StaleObjectError, ActiveRecord::RecordNotFound => error logger.info "**** Concurrent access at events queue (max_tries=#{max_tries})." |