Sha256: ed4cb9cb6c1ec8713f1484e948fddc2852d6272eee37431e8023e57f0e6d0511
Contents?: true
Size: 584 Bytes
Versions: 16
Compression:
Stored size: 584 Bytes
Contents
class AlertExecution @queue = :alert_exec def self.perform(alert_id, role) alert = Alert.find(alert_id) alert.status = Alert::STATUSES.pending alert.save! interaction = Interaction::ResultCreation.new( query_version_id: alert.latest_query_version.id, owner: alert.user ) result = interaction.execute if interaction.errors.any? alert.error(interaction.errors.join(', ')) else alert.last_alert_result = result alert.save! QueryExecution.perform(result.id, role) alert.check_last_result end end end
Version data entries
16 entries across 16 versions & 1 rubygems