Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit 45736ec

Browse files
committed
Fixed #777: incremental load only looked at content db for timestamps
1 parent 8b3ac5d commit 45736ec

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

deploy/lib/server_config.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,13 +1699,15 @@ def filter_to_newer_files(files, options)
16991699
end
17001700

17011701
uris = files.map { |f| xcc.build_target_uri(f, options) }
1702-
stamps_db = get_db_timestamps(uris)
1702+
stamps_db = get_db_timestamps(uris, options[:db])
17031703
stamps_local = files.map { |file_uri| File.mtime(file_uri).getgm.iso8601(5) }
17041704

17051705
files_with_stamps = files.zip(stamps_local, stamps_db)
17061706

17071707
filtered = files_with_stamps.select do |file_uri, stamp_locally, stamp_in_db|
17081708

1709+
stamp_in_db = stamp_in_db || ""
1710+
17091711
newer = (stamp_locally > stamp_in_db || stamp_in_db.strip.empty?)
17101712

17111713
if (!newer)
@@ -1718,11 +1720,11 @@ def filter_to_newer_files(files, options)
17181720
filtered.map { |f, stamp1, stamp2| f}
17191721
end
17201722

1721-
def get_db_timestamps(uris)
1723+
def get_db_timestamps(uris, target_db)
17221724
uris_as_string = uris.map{|i| "\"#{i}\""}.join(",")
17231725
q = %Q{for $u in (#{uris_as_string}) return "" || adjust-dateTime-to-timezone(xdmp:timestamp-to-wallclock(xdmp:document-timestamp($u)), xs:dayTimeDuration("PT0H"))}
17241726

1725-
result = execute_query q, :db_name => @properties["ml.content-db"]
1727+
result = execute_query q, :db_name => target_db
17261728
parse_body(result.body).split("\n")
17271729
end
17281730

0 commit comments

Comments
 (0)