When logged in as Admin you can start a Import cron job by simply calling GET /admin/scheduletask/runjob/{IDJOB}. Is there a way to execute this command externally, for example we want to only run the cron job when we have changed the data in the Import CSV file. Else it would run the import job every minute which doesn't sounds very efficient instead we would like to trigger it like an event. So new data in CSV -->> run Import cron job.
Start Import Cron Job remote
#1
Geschrieben: 30 January 2020 - 15:41
#2
Geschrieben: 30 January 2020 - 19:05
No. That would cause security problems. You can change the execution interval of each job by Cron expression or start a job by code through ITaskScheduler.RunSingleTask in combination of a ImportExecutedEvent handler.
Marcus Gesing
Smartstore AG
#3
Geschrieben: 31 January 2020 - 16:11
That's what I thought ;-) Is it possible otherwise via the WebApi? Will want to trigger the action itself when a change has taken place.
#4
Geschrieben: 31 January 2020 - 18:53
No, only by code.
Marcus Gesing
Smartstore AG
#5
Geschrieben: 17 February 2020 - 16:00
If i use the /Uploads/ImportFiles endpoint as described here: https://docs.smartst... to Data Import to upload Import CSV data would that automatically trigger the import function? I do hope so because then i won't have to schedule a cron job to look every minute for changes.
Side note: Is it possible to disable the email you get with the import result? If i set a cron job for a import profile to run every minute i get a lot of emails….
#6
Geschrieben: 17 February 2020 - 17:38
Marcus Gesing
Smartstore AG
#7
Geschrieben: 18 February 2020 - 08:20
Would it be possible to add a property to the /Uploads/ImportFiles like "ExecuteImportOnUpload" ? telling the endpoint that after an upload was succesfull an import has to be started?
#9
Geschrieben: 21 February 2020 - 17:44
Thats great! Do you have an estimation when this would be implemented?
#10
Geschrieben: 21 February 2020 - 19:59
It's already implemented as you can see in the issue.
Marcus Gesing
Smartstore AG