# HG changeset patch # User bsw # Date 1330557554 -3600 # Node ID e1d60ee19e5234f5c900b9051a9ef3e395420cf6 # Parent a80e74881cafea865043c58a064266f8e04d555d Add notification sent loop to Event model diff -r a80e74881caf -r e1d60ee19e52 model/event.lua --- a/model/event.lua Thu Mar 01 00:08:06 2012 +0100 +++ b/model/event.lua Thu Mar 01 00:19:14 2012 +0100 @@ -79,6 +79,7 @@ print(body) print("") + end function Event:send_next_notification() @@ -108,10 +109,21 @@ end event:send_notification() - - else - return last_event_id + + return true end +end + +function Event:send_notifications_loop() + + while true do + local did_work = Event:send_next_notification() + if not did_work then + print "Sleeping 1 second" + os.execute("sleep 1") + end + end + end \ No newline at end of file