Class: Nexo::FolderDownloadJob

Inherits:
BaseJob
  • Object
show all
Defined in:
app/jobs/nexo/folder_download_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(folder, type) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/jobs/nexo/folder_download_job.rb', line 3

def perform(folder, type)
  if type == "full_sync"
    GoogleCalendarSyncService.new(folder.integration).full_sync!(folder)
  elsif type == "incremental_sync"
    GoogleCalendarSyncService.new(folder.integration).incremental_sync!(folder)
  elsif type == "full_or_incremental_sync"
    GoogleCalendarSyncService.new(folder.integration).full_or_incremental_sync!(folder)
  else
    raise "unknown sync type"
  end
end