From 211e189e0308ae15a993012e82773204f36da783 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 31 Aug 2012 21:04:47 +0200 Subject: markov: be more robust about flaky dbs Due to historical bugs, some database entries may have ended up being serialized as strings. Recover from this by making them into arrays. --- data/rbot/plugins/markov.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'data') diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index 621935c6..eb9294e2 100755 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -183,6 +183,9 @@ class MarkovPlugin < Plugin @upgrade_queue.push nil @upgrade_thread = Thread.new do + @registry.recovery = Proc.new { |val| + return [val] + } logfile = File.open(@bot.path('markov-conversion.log'), 'a') logfile.puts "=== conversion thread started #{Time.now} ===" while k = @upgrade_queue.pop @@ -199,6 +202,7 @@ class MarkovPlugin < Plugin end logfile.puts "=== conversion thread stopped #{Time.now} ===" logfile.close + @registry.recovery = nil end @upgrade_thread.priority = -1 end -- cgit v1.2.3