We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 395332d commit ecf7de2Copy full SHA for ecf7de2
src/placeos-driver/task.cr
@@ -121,6 +121,7 @@ class PlaceOS::Driver::Task
121
#
122
# The result should support conversion to JSON otherwise the remote will only receive `nil`
123
def success(result = nil, @code = 200)
124
+ return self unless @state.unknown?
125
@state = :success
126
@wait = false
127
@@ -168,9 +169,11 @@ class PlaceOS::Driver::Task
168
169
170
# call when the task has failed and we don't want to retry
171
def abort(reason = nil, @code = 500)
172
173
+ @state = :abort
174
+
175
stop_timers
176
- @state = :abort
177
@payload = reason.to_s if reason
178
@channel.close
179
@complete.send true
0 commit comments