Commit 220a47c89c5d9440e977fef745d658c9853d7291
1 parent
fa512fa6
Exists in
staging
and in
4 other branches
virtuoso: added action to force harvest from start
Showing
3 changed files
with
8 additions
and
2 deletions
Show diff stats
plugins/virtuoso/controllers/virtuoso_plugin_admin_controller.rb
... | ... | @@ -15,7 +15,7 @@ class VirtuosoPluginAdminController < AdminController |
15 | 15 | |
16 | 16 | def force_harvest |
17 | 17 | harvest = VirtuosoPlugin::DspaceHarvest.new(environment) |
18 | - harvest.start | |
18 | + harvest.start(params[:from_start]) | |
19 | 19 | session[:notice] = _('Harvest started') |
20 | 20 | redirect_to :action => :index |
21 | 21 | end | ... | ... |
plugins/virtuoso/lib/virtuoso_plugin/dspace_harvest.rb
... | ... | @@ -49,8 +49,13 @@ class VirtuosoPlugin::DspaceHarvest |
49 | 49 | puts "ending harvest #{harvest_time}" |
50 | 50 | end |
51 | 51 | |
52 | - def start | |
52 | + def start(from_start = false) | |
53 | 53 | if find_job.empty? |
54 | + if from_start | |
55 | + settings.last_harvest = nil | |
56 | + settings.save! | |
57 | + end | |
58 | + | |
54 | 59 | job = VirtuosoPlugin::DspaceHarvest::Job.new(@environment.id) |
55 | 60 | Delayed::Job.enqueue(job) |
56 | 61 | end | ... | ... |
plugins/virtuoso/views/virtuoso_plugin_admin/index.html.erb