use overwrite semantics for remote file distributor

This commit is contained in:
r888888888
2016-02-02 16:59:14 -08:00
parent 3d9b7f797a
commit 48aa4cc3d6
2 changed files with 4 additions and 3 deletions

View File

@@ -18,8 +18,9 @@ class RemoteFileManager
ftp.rename!(temp_path, path)
rescue Net::SFTP::StatusException
# this typically means the file already exists
# so just clean up
ftp.remove(temp_path)
# so delete and try renaming again
ftp.remove!(path)
ftp.rename!(temp_path, path)
end
end
end

View File

@@ -1,7 +1,7 @@
<script type="text/javascript">
$(function() {
var tags = $("#tags").val();
if (Danbooru.get_url_parameter("ms") === "1" && tags && tags.length > 0 && $(".post-preview").size() < 10) {
if (Danbooru.get_url_parameter("ms") === "1" && tags && tags.length > 0 && $(".post-preview").size() === 0) {
$.post("<%= Danbooru.config.report_server %>/missed_searches", {
session_id: "<%= session_id %>",
tags: $("#tags").val(),