summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2017-01-08 19:16:30 +0100
committerPiotr Dobrowolski <admin@tastycode.pl>2017-01-08 19:16:30 +0100
commit63fad35d0bc27780ce15d7d317f1e468940ab954 (patch)
tree21e7dc2d456160113e7e724c80ace010b878a517
parenta8d82e060066a78792786693cbf5a1188dad6ee0 (diff)
downloadlove2d-signage-63fad35d0bc27780ce15d7d317f1e468940ab954.tar.gz
love2d-signage-63fad35d0bc27780ce15d7d317f1e468940ab954.tar.bz2
love2d-signage-63fad35d0bc27780ce15d7d317f1e468940ab954.tar.xz
love2d-signage-63fad35d0bc27780ce15d7d317f1e468940ab954.zip
Better thread error handling
-rw-r--r--main.lua14
-rw-r--r--screens/misery.lua3
-rw-r--r--screens/weather.lua3
3 files changed, 17 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index 69458c2..65321bf 100644
--- a/main.lua
+++ b/main.lua
@@ -1,6 +1,7 @@
local debugGraph = require 'vendor.debugGraph'
local inspect = require 'vendor.inspect'
local push = require 'vendor.push'
+local lurker = require 'vendor.lurker'
environment = os.getenv('ENV')
@@ -46,6 +47,17 @@ function love.load()
for key, node in ipairs(screens) do
node.load()
end
+
+ lurker.quiet = true
+end
+
+function lurker.preswap(f)
+ print(f)
+
+ if f:match('_thread.lua') then
+ print("Preventing _thread update!")
+ return false
+ end
end
function getw() return push:getWidth() end
@@ -106,5 +118,5 @@ function love.update(dt)
fpsGraph:update(dt)
memGraph:update(dt)
- require("vendor.lurker").update()
+ lurker.update()
end
diff --git a/screens/misery.lua b/screens/misery.lua
index e4d6258..28d1151 100644
--- a/screens/misery.lua
+++ b/screens/misery.lua
@@ -36,7 +36,8 @@ function node.render()
end
function node.update(dt)
- if lastUpdate < love.timer.getTime() - updateInterval then
+ if lastUpdate < love.timer.getTime() - updateInterval or
+ (not state and lastUpdate < love.timer.getTime() - 5) then
lastUpdate = love.timer.getTime()
print("Updating...")
diff --git a/screens/weather.lua b/screens/weather.lua
index 779ff10..98b2416 100644
--- a/screens/weather.lua
+++ b/screens/weather.lua
@@ -51,7 +51,8 @@ function node.render()
end
function node.update(dt)
- if lastUpdate < love.timer.getTime() - updateInterval then
+ if lastUpdate < love.timer.getTime() - updateInterval or
+ (not state and lastUpdate < love.timer.getTime() - 5) then
lastUpdate = love.timer.getTime()
print("Updating...")