|
4 | 4 | # --- BEGIN_HEADER --- |
5 | 5 | # |
6 | 6 | # resman - manage resources |
7 | | -# Copyright (C) 2003-2021 The MiG Project lead by Brian Vinter |
| 7 | +# Copyright (C) 2003-2025 The MiG Project lead by the Science HPC Center at UCPH |
8 | 8 | # |
9 | 9 | # This file is part of MiG. |
10 | 10 | # |
|
20 | 20 | # |
21 | 21 | # You should have received a copy of the GNU General Public License |
22 | 22 | # along with this program; if not, write to the Free Software |
23 | | -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 23 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
| 24 | +# USA. |
24 | 25 | # |
25 | 26 | # -- END_HEADER --- |
26 | 27 | # |
|
41 | 42 | from mig.shared.modified import pending_resources_update, pending_vgrids_update |
42 | 43 | from mig.shared.resource import anon_to_real_res_map |
43 | 44 | from mig.shared.vgridaccess import user_visible_res_confs, get_resource_map, \ |
44 | | - OWNERS, CONF |
| 45 | + load_resource_map, CONF, OWNERS |
45 | 46 |
|
46 | 47 | list_operations = ['showlist', 'list'] |
47 | 48 | show_operations = ['show', 'showlist'] |
@@ -155,7 +156,11 @@ def main(client_id, user_arguments_dict): |
155 | 156 | logger.info("get vgrid and resource map with caching %s" % caching) |
156 | 157 | visible_res_confs = user_visible_res_confs(configuration, client_id, |
157 | 158 | caching) |
158 | | - res_map = get_resource_map(configuration, caching) |
| 159 | + # NOTE: prevent refresh if janitor is enabled as it handles all updates |
| 160 | + if configuration.site_enable_janitor: |
| 161 | + (res_map, _) = load_resource_map(configuration, caching=caching) |
| 162 | + else: |
| 163 | + res_map = get_resource_map(configuration, caching) |
159 | 164 | anon_map = anon_to_real_res_map(configuration.resource_home) |
160 | 165 |
|
161 | 166 | # NOTE: use simple pending check if caching to avoid lock during update |
|
0 commit comments