Package backend :: Package server :: Package importlib :: Module errataCache
[hide private]
[frames] | no frames]

Source Code for Module backend.server.importlib.errataCache

 1  # 
 2  # Copyright (c) 2008--2015 Red Hat, Inc. 
 3  # 
 4  # This software is licensed to you under the GNU General Public License, 
 5  # version 2 (GPLv2). There is NO WARRANTY for this software, express or 
 6  # implied, including the implied warranties of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 
 8  # along with this software; if not, see 
 9  # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 
10  # 
11  # Red Hat trademarks are not licensed under GPLv2. No permission is 
12  # granted to use or replicate Red Hat trademarks that are incorporated 
13  # in this software or its documentation. 
14  # 
15  # 
16  # Adds tasks to be executed by the errata cache daemon 
17  # 
18   
19  from spacewalk.server import rhnSQL 
20   
21   
22 -def schedule_errata_cache_update(channels):
23 # If no channels were supplied, exit here to shortcut parsing the query 24 if not channels: 25 return 26 h = rhnSQL.prepare(""" 27 insert into rhnTaskQueue 28 (org_id, task_name, task_data, priority, earliest) 29 select coalesce(c.org_id, 1), 'update_errata_cache_by_channel', c.id, 0, current_timestamp 30 from rhnChannel c 31 where c.label = :label 32 """) 33 h.executemany(label=channels) 34 rhnSQL.commit()
35