maestrano/mno-enterprise

View on GitHub
api/app/models/mno_enterprise/health_check.rb

Summary

Maintainability
A
0 mins
Test Coverage
module MnoEnterprise
  class HealthCheck
    # Check API connection with Mno-Hub
    # any code that returns blank on success and non blank string upon failure
    def self.perform_mno_hub_check
      # TODO: less expensive test
      if MnoEnterprise::App.first
        ''
      else
        'MNO-HUB'
      end
    rescue => e
      "MNO-HUB: #{e}. "
    end
  end
end