Skip to content

Commit

Permalink
Adjusted BACs slightly
Browse files Browse the repository at this point in the history
prioux committed Aug 13, 2024
1 parent 2d713fd commit eafabe2
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BrainPortal/app/models/background_activity.rb
Original file line number Diff line number Diff line change
@@ -733,7 +733,7 @@ def record_in_rails_log #:nodoc:
if File.directory?(Rails.root + "data_dumps/bacs")
username = self.user.login
File.open(Rails.root + "data_dumps/bacs/#{username}.jsonl","a") do |fh|
fh.write(json_text + "\n")
fh.write(json_text + "\n")
end
end

Original file line number Diff line number Diff line change
@@ -52,7 +52,8 @@ def process(item) # item is like "TextFile-abcd.xyz"
dest_dp = DataProvider.find(dest_dp_id)
newfile = userfile.provider_copy_to_otherprovider(dest_dp)
userfile.unregister # we leave the original content on the DP, but not registered.
[ true, newfile.id ]
return [ true, newfile.id ] if newfile.is_a?(Userfile)
return [ false, "Copy failed" ] # when provider_copy returns false
end

end
Original file line number Diff line number Diff line change
@@ -50,8 +50,9 @@ def process(item) # item is like "TextFile-abcd.xyz"
dest_dp_id = self.options[:dest_data_provider_id]
userfile = Userfile.find(userfile_id)
dest_dp = DataProvider.find(dest_dp_id)
userfile.provider_move_to_otherprovider(dest_dp)
[ true, userfile.id ]
move_ok = userfile.provider_move_to_otherprovider(dest_dp)
return [ true, userfile.id ] if move_ok
return [ false, "Registered but cannot be moved" ]
end

end

0 comments on commit eafabe2

Please sign in to comment.