Skip to content

Commit

Permalink
Limits number of commands in bot output
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetsoftware committed Dec 13, 2015
1 parent 2c1e3b4 commit 8bc3187
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/Bot.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1>{{botid}}</h1>
}

}
setInterval(refresh_term, 1000)
setInterval(refresh_term, 2000)
$(document).ready(function(){
refresh_term();
});
Expand Down
4 changes: 2 additions & 2 deletions server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def push(self, botid, cmd):
@cherrypy.expose
def stdout(self, botid):
output = ""
bot_output = query_DB('SELECT * FROM output WHERE bot=? ORDER BY date', (botid,))
for entry in bot_output:
bot_output = query_DB('SELECT * FROM output WHERE bot=? ORDER BY date DESC LIMIT 10', (botid,))
for entry in reversed(bot_output):
output += "> %s\n\n" % entry[2]
bot_queue = query_DB('SELECT * FROM commands WHERE bot=? and sent=? ORDER BY date', (botid, 0))
for entry in bot_queue:
Expand Down

0 comments on commit 8bc3187

Please sign in to comment.