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

Commit fb773db

Browse files
Merge pull request #778 from grtjn/777-incremental-deploy-modules
Fixed #777: incremental load only looked at content db for timestamps
2 parents 6ed0531 + 45736ec commit fb773db

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
@@ -1764,13 +1764,15 @@ def filter_to_newer_files(files, options)
17641764
end
17651765

17661766
uris = files.map { |f| xcc.build_target_uri(f, options) }
1767-
stamps_db = get_db_timestamps(uris)
1767+
stamps_db = get_db_timestamps(uris, options[:db])
17681768
stamps_local = files.map { |file_uri| File.mtime(file_uri).getgm.iso8601(5) }
17691769

17701770
files_with_stamps = files.zip(stamps_local, stamps_db)
17711771

17721772
filtered = files_with_stamps.select do |file_uri, stamp_locally, stamp_in_db|
17731773

1774+
stamp_in_db = stamp_in_db || ""
1775+
17741776
newer = (stamp_locally > stamp_in_db || stamp_in_db.strip.empty?)
17751777

17761778
if (!newer)
@@ -1783,11 +1785,11 @@ def filter_to_newer_files(files, options)
17831785
filtered.map { |f, stamp1, stamp2| f}
17841786
end
17851787

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

1790-
result = execute_query q, :db_name => @properties["ml.content-db"]
1792+
result = execute_query q, :db_name => target_db
17911793
parse_body(result.body).split("\n")
17921794
end
17931795

0 commit comments

Comments
 (0)