Class: CanvasSync::Jobs::SyncAccountsJob

Inherits:
ReportStarter show all
Defined in:
lib/canvas_sync/jobs/sync_accounts_job.rb

Instance Attribute Summary

Attributes inherited from CanvasSync::Job

#job_log

Instance Method Summary collapse

Methods inherited from CanvasSync::Job

#create_job_log, #report_checker_wait_time, #update_or_create_model

Instance Method Details

#perform(options) ⇒ Object

Starts a provisioning report for just accounts.

Provisioning reports do not scope accounts by term, so when we are running provisioning by term we sync users first so we don’t duplicate the work of syncing all accounts for each term.

Parameters:

  • options (Hash)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/canvas_sync/jobs/sync_accounts_job.rb', line 11

def perform(options)
  unless options[:root_account] == false
    acc_params = CanvasSync.get_canvas_sync_client(batch_context).("self")
    update_or_create_model(Account, acc_params)
  end

  super(
    "proservices_provisioning_csv",
    merge_report_params(options, {
      accounts: true,
      include_deleted: true,
    }, term_scope: false),
    CanvasSync::Processors::ProvisioningReportProcessor.to_s,
    { models: ["accounts"] },
  )
end