310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
# File 'lib/openc3/models/reaction_model.rb', line 310
def undeploy
return unless ReactionModel.names(scope: @scope).empty?
model = MicroserviceModel.get_model(name: @microservice_name, scope: @scope)
if model
notification = {
'kind' => 'undeployed',
'type' => 'reaction',
'data' => JSON.generate({
'name' => @microservice_name,
'updated_at' => Time.now.to_nsec_from_epoch,
}),
}
AutonomicTopic.write_notification(notification, scope: @scope)
model.destroy
end
end
|