Skip to content

Commit

Permalink
Open the doors to the sygne demonic realm
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl committed Oct 22, 2024
1 parent da3d65e commit ccf21c7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
5 changes: 0 additions & 5 deletions app/jobs/sync/classes_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ class ClassesJob < ApplicationJob
end

def perform(establishment, school_year)
# NOTE: there is a bug in Sygne where students are removed from classes
# earlier than they should be so we disable student list fetching for now
# (only in production because we want to keep our tests intact)
return true if establishment.provided_by?(:sygne) && Rails.env.production?

api = establishment.students_api

api
Expand Down
1 change: 0 additions & 1 deletion app/jobs/sync/student_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class StudentJob < ApplicationJob
def perform(schooling)
student = schooling.student

return true if schooling.establishment.provided_by?(:sygne) && Rails.env.production?
return true if student.ine_not_found || schooling.closed?

fetch_student_data(schooling)
Expand Down
12 changes: 2 additions & 10 deletions app/jobs/sync/student_schoolings_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@ class StudentSchoolingsJob < ApplicationJob
retry_on Faraday::TooManyRequestsError, wait: 1.hour, attempts: 3

def perform(student)
# There are students with no schoolings at all
# NOTE: There are students with no schoolings at all
# Student.where.missing(:schoolings).count
return true if student.establishment.blank?

# XXX: Sygne temporarily disabled see issue:
# https://github.com/orgs/betagouv/projects/71/views/1?pane=issue&itemId=70119483
if (student.establishment.provided_by?(:sygne) && Rails.env.production?) || student.current_schooling.nil?
return true
end

return true if student.current_schooling.removed?
return true if student.establishment.blank? || student.current_schooling.removed?

Updaters::StudentSchoolingsUpdater.call(student)
end
Expand Down

0 comments on commit ccf21c7

Please sign in to comment.