Skip to content

Instantly share code, notes, and snippets.

Created September 16, 2012 00:41
Show Gist options
  • Save anonymous/3730584 to your computer and use it in GitHub Desktop.
Save anonymous/3730584 to your computer and use it in GitHub Desktop.
last_message_id = 0
loop do
messages = Message.where("id > ?", last_message_id)
logger.info messages.to_json
last_message_id = messages.last.id if messages.any?
sleep 5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment