liquid_feedback_frontend

changeset 364:e1d60ee19e52

Add notification sent loop to Event model
author bsw
date Thu Mar 01 00:19:14 2012 +0100 (2012-03-01)
parents a80e74881caf
children 5e3fa663adba
files model/event.lua
line diff
     1.1 --- a/model/event.lua	Thu Mar 01 00:08:06 2012 +0100
     1.2 +++ b/model/event.lua	Thu Mar 01 00:19:14 2012 +0100
     1.3 @@ -79,6 +79,7 @@
     1.4  
     1.5    print(body)
     1.6    print("")
     1.7 +  
     1.8  end
     1.9  
    1.10  function Event:send_next_notification()
    1.11 @@ -108,10 +109,21 @@
    1.12      end
    1.13      
    1.14      event:send_notification()
    1.15 -
    1.16 -  else
    1.17 -    return last_event_id
    1.18 +    
    1.19 +    return true
    1.20  
    1.21    end
    1.22  
    1.23 +end
    1.24 +
    1.25 +function Event:send_notifications_loop()
    1.26 +
    1.27 +  while true do
    1.28 +    local did_work = Event:send_next_notification()
    1.29 +    if not did_work then
    1.30 +      print "Sleeping 1 second"
    1.31 +      os.execute("sleep 1")
    1.32 +    end
    1.33 +  end
    1.34 +  
    1.35  end
    1.36 \ No newline at end of file

Impressum / About Us