[ARVADOS] updated: 7409b2f682d562cd7ef7bcf558597ae2181ea7c1
Git user
git at public.curoverse.com
Fri Jun 16 09:35:18 EDT 2017
Summary of changes:
services/api/app/models/node.rb | 3 +++
1 file changed, 3 insertions(+)
via 7409b2f682d562cd7ef7bcf558597ae2181ea7c1 (commit)
from 82de7379de9a488a1e5ace7bb854a4c271c466a8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 7409b2f682d562cd7ef7bcf558597ae2181ea7c1
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Jun 16 09:34:08 2017 -0400
11283: Add explanatory comment to SQL query.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>
diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index e1c1e64..8eb40f9 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -139,6 +139,9 @@ class Node < ArvadosModel
protected
def self.available_slot_number
+ # Join the sequence 1..max with the nodes table. Return the first
+ # (i.e., smallest) value that doesn't match the slot_number of any
+ # existing node.
connection.exec_query('SELECT n FROM generate_series(1, $1) AS slot(n)
LEFT JOIN nodes ON n=slot_number
WHERE slot_number IS NULL
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list