Skip to content

bug in timeout calculation #12

@skypexu

Description

@skypexu
diff --git a/include/watchers/timeout.h b/include/watchers/timeout.h
index 98b0576..a275cf9 100644
--- a/include/watchers/timeout.h
+++ b/include/watchers/timeout.h
@@ -182,7 +182,7 @@ public:
         // in that case we won't reset the timer to not interfere with the event loop,
         // but only update the expire time, when the timer then expires, the callback
         // will not be called, but a new timer is going to be set instead
-        if (_active && _loop->now() + timeout < _expire)
+        if (_active && _loop->now() + timeout >= _expire)
         {
             // set the new expire time
             _expire = _loop->now() + timeout;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions