aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-09-04 09:27:42 +0000
committers-ol <s-ol@users.noreply.github.com>2020-09-04 09:31:12 +0000
commit0a354d179836a079c2cee4f77da9705478080cf1 (patch)
tree2e7793f104dba9043a7cc9cf497935fb96f1b921
parentremove IOStreams, support optional polling in Ops (diff)
downloadalive-0a354d179836a079c2cee4f77da9705478080cf1.tar.gz
alive-0a354d179836a079c2cee4f77da9705478080cf1.zip
only increment tick if IO was triggered
-rw-r--r--alv/copilot/base.moon6
1 files changed, 3 insertions, 3 deletions
diff --git a/alv/copilot/base.moon b/alv/copilot/base.moon
index 9306e3c..642098b 100644
--- a/alv/copilot/base.moon
+++ b/alv/copilot/base.moon
@@ -104,7 +104,6 @@ class Copilot
return unless @last_modules.__root
COPILOT = @
- @T += 1
ok, err = @poll!
if not ok
@@ -114,8 +113,9 @@ class Copilot
if root and root.root
L\set_time 'run'
ok, error = Error.try "updating", ->
- root.root\poll_io!
- root.root\tick!
+ if root.root\poll_io!
+ root.root\tick!
+ @T += 1
if not ok
L\print error