File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11name : placeos-driver
2- version : 7.2.18
2+ version : 7.3.0
33
44dependencies :
55 action-controller :
Original file line number Diff line number Diff line change @@ -85,21 +85,25 @@ class PlaceOS::Driver::DriverManager
8585 # we don't want to block driver init processing too long
8686 # a driver might be making a HTTP request in on_load for exampe which
8787 # could block for a long time, resulting in poor feedback
88- if driver.responds_to?(:on_load )
88+ if driver.responds_to?(:on_load ) || driver.responds_to?( :on_update )
8989 wait_on_load = Channel (Nil ).new
9090 spawn(same_thread: true ) do
9191 begin
92- driver.on_load
92+ if driver.responds_to?(:on_load )
93+ driver.on_load
94+ elsif driver.responds_to?(:on_update )
95+ driver.on_update
96+ end
9397 rescue error
94- logger.error(exception: error) { " in the on_load function of #{ driver.class } (#{ @module_id } )" }
98+ logger.error(exception: error) { " initializing #{ driver.class } (#{ @module_id } )" }
9599 end
96100 wait_on_load.send nil
97101 end
98102
99103 select
100104 when wait_on_load.receive
101105 when timeout(6 .seconds)
102- logger.error { " timeout waiting for the on_load function of #{ driver.class } (#{ @module_id } )" }
106+ logger.error { " timeout initializing #{ driver.class } (#{ @module_id } )" }
103107 end
104108
105109 wait_on_load.close
You can’t perform that action at this time.
0 commit comments