Merge branch 'main' from workbench2.git
[arvados.git] / services / api / app / models / keep_disk.rb
index da421ebb4cb92f13369a4517ef80583642d54844..589936f84521d1fa66460b088fccbc8e31468b7a 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class KeepDisk < ArvadosModel
   include HasUuid
   include KindAndEtag
@@ -36,7 +40,7 @@ class KeepDisk < ArvadosModel
     end
 
     @bypass_arvados_authorization = true
-    self.update_attributes!(o.select { |k,v|
+    self.update!(o.select { |k,v|
                              [:bytes_total,
                               :bytes_free,
                               :is_readable,
@@ -44,7 +48,7 @@ class KeepDisk < ArvadosModel
                               :last_read_at,
                               :last_write_at
                              ].collect(&:to_s).index k
-                           }.merge(last_ping_at: Time.now))
+                           }.merge(last_ping_at: db_current_time))
   end
 
   def service_host