From ec64f18138e27e82410d99319b4e4a7d4e5756b9 Mon Sep 17 00:00:00 2001 From: topkecleon Date: Fri, 4 Mar 2016 13:06:13 -0500 Subject: [PATCH] lastfm.lua: Added timeout to prevent bot from locking up. --- plugins/lastfm.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/lastfm.lua b/plugins/lastfm.lua index 3549824..9e271c7 100755 --- a/plugins/lastfm.lua +++ b/plugins/lastfm.lua @@ -8,6 +8,9 @@ if not database.lastfm then database.lastfm = {} end +local HTTP = require('socket.http') +HTTP.TIMEOUT = 1 + local command = 'lastfm' local doc = [[``` /np [username] @@ -62,7 +65,7 @@ local action = function(msg) url = url .. URL.escape(username) - jstr, res = HTTPS.request(url) + jstr, res = HTTP.request(url) if res ~= 200 then sendReply(msg, config.errors.connection) return