sync_subjects_in_foreground

in app/models/repository.rb [53:67]


  def sync_subjects_in_foreground
    subject_urls = notifications.subjectable.distinct.pluck(:subject_url)
    return unless app_installation
    client = app_installation.github_client
    subject_urls.each do |subject_url|
      begin
        remote_subject = client.get(subject_url)
        SyncSubjectWorker.perform_async_if_configured(remote_subject.to_h)
      rescue Octokit::ClientError, Octokit::Forbidden => e
        Rails.logger.warn("\n\n\033[32m[#{Time.current}] WARNING -- #{e.message}\033[0m\n\n")
        nil
      end
    end
  end