Module: Services::SubmitMdsFileForProcessing

Defined in:
app/roles/services/submit_mds_file_for_processing.rb

Constant Summary collapse

TIME_TO_RUN =
36000
PRIORITY =
500
ASYNC_SEND_OPTIONS =
{ :priority => PRIORITY, :time_to_run => TIME_TO_RUN }

Instance Method Summary collapse

Instance Method Details

#submit_uploaded_fileObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/roles/services/submit_mds_file_for_processing.rb', line 8

def submit_uploaded_file
  errors = []
  mds_upload = MdsUpload.new(:account => ,
                             :mds_file => uploaded_file, 
                             :status => MdsUpload::NEW, 
                             :upload_user => upload_user,
                             :file_errors => {},
                             :notify_uploader => notify_uploader)

  if mds_upload.valid?
    mds_upload.save!
    MdsFileProcessingContext.ayl_send_opts(:call, ASYNC_SEND_OPTIONS, mds_upload)
  else
    errors.concat(mds_upload.errors[:mds_file])
  end
  errors
end