aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wilmott <p@p8952.info>2015-02-14 22:25:03 +0000
committerPeter Wilmott <p@p8952.info>2015-02-14 22:25:03 +0000
commite0625494860b832f89720c57a450289de5a5c7b8 (patch)
tree9b8fd049972cc5c9c00309504cee7cc61c12ee58
parentAdd timestamps to pages using the 'builds' and 'repomans' tables (diff)
downloadruby-tinderbox-e0625494860b832f89720c57a450289de5a5c7b8.tar.gz
ruby-tinderbox-e0625494860b832f89720c57a450289de5a5c7b8.tar.bz2
ruby-tinderbox-e0625494860b832f89720c57a450289de5a5c7b8.zip
Improve the way timestamps are set after updating
-rw-r--r--web/lib/ci.rb6
-rw-r--r--web/lib/packages.rb6
-rw-r--r--web/lib/repoman.rb6
3 files changed, 6 insertions, 12 deletions
diff --git a/web/lib/ci.rb b/web/lib/ci.rb
index 0e6a0d2..73e47d9 100644
--- a/web/lib/ci.rb
+++ b/web/lib/ci.rb
@@ -50,10 +50,8 @@ def run_ci(docker_image, num_of_packages)
update_timestamp = Time.now.to_i
portage_timestamp = File.read('/usr/portage/metadata/timestamp.x').split.first
- Build.each do |build|
- build.update(update_timestamp: update_timestamp)
- build.update(portage_timestamp: portage_timestamp)
- end
+ Build.dataset.update(update_timestamp: update_timestamp)
+ Build.dataset.update(portage_timestamp: portage_timestamp)
end
def update_ci
diff --git a/web/lib/packages.rb b/web/lib/packages.rb
index 8a032b0..e76eef9 100644
--- a/web/lib/packages.rb
+++ b/web/lib/packages.rb
@@ -33,8 +33,6 @@ def update_packages
update_timestamp = Time.now.to_i
portage_timestamp = File.read('/usr/portage/metadata/timestamp.x').split.first
- Package.each do |package|
- package.update(update_timestamp: update_timestamp)
- package.update(portage_timestamp: portage_timestamp)
- end
+ Package.dataset.update(update_timestamp: update_timestamp)
+ Package.dataset.update(portage_timestamp: portage_timestamp)
end
diff --git a/web/lib/repoman.rb b/web/lib/repoman.rb
index 80e0037..4de3b1a 100644
--- a/web/lib/repoman.rb
+++ b/web/lib/repoman.rb
@@ -52,10 +52,8 @@ def run_repoman(docker_image, num_of_packages)
update_timestamp = Time.now.to_i
portage_timestamp = File.read('/usr/portage/metadata/timestamp.x').split.first
- Repoman.each do |repoman|
- repoman.update(update_timestamp: update_timestamp)
- repoman.update(portage_timestamp: portage_timestamp)
- end
+ Repoman.dataset.update(update_timestamp: update_timestamp)
+ Repoman.dataset.update(portage_timestamp: portage_timestamp)
end
def update_repoman