mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 14:29:42 +08:00
MockModuleBuilder: Share root cache between threads
The different build threads all are using the same basic build root contents, so there's no reason to use separate caches - point the root cache plugin for mock to a single location. (There's locking inside Mock for updating the root cache.)
This commit is contained in:
@@ -6,6 +6,7 @@ import os
|
||||
import pipes
|
||||
import re
|
||||
import subprocess
|
||||
from textwrap import dedent
|
||||
import threading
|
||||
|
||||
import dnf
|
||||
@@ -483,6 +484,11 @@ class MockModuleBuilder(GenericBuilder):
|
||||
config = config.replace("$enabled_modules", str(self.enabled_modules))
|
||||
config = config.replace("$releasever", str(self.releasever))
|
||||
|
||||
config += dedent("""\
|
||||
config_opts.setdefault('plugin_conf', {})
|
||||
config_opts['plugin_conf'].setdefault('root_cache_opts', {})
|
||||
config_opts['plugin_conf']['root_cache_opts']['dir'] = "{{cache_topdir}}/%s/root_cache/"
|
||||
""") % self.tag_name
|
||||
|
||||
mock_cfg_path = os.path.join(self.configdir, "mock.cfg")
|
||||
if update_main or not os.path.exists(mock_cfg_path):
|
||||
|
||||
Reference in New Issue
Block a user