Skip to content

Commit b10ba9b

Browse files
ianballouekohl
authored andcommitted
Fixes #36772 - container gateway db timeout tuning
1 parent 146218e commit b10ba9b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

manifests/plugin/container_gateway.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#
77
# $sqlite_db_path:: Absolute path for the SQLite DB file to exist at
88
#
9+
# $sqlite_timeout:: Database busy timeout in milliseconds
10+
#
911
# === Advanced parameters:
1012
#
1113
# $enabled:: enables/disables the pulp plugin
@@ -21,6 +23,7 @@
2123
Foreman_proxy::ListenOn $listen_on = 'https',
2224
Stdlib::HTTPUrl $pulp_endpoint = "https://${facts['networking']['fqdn']}",
2325
Stdlib::Absolutepath $sqlite_db_path = '/var/lib/foreman-proxy/smart_proxy_container_gateway.db',
26+
Optional[Integer] $sqlite_timeout = undef,
2427
) {
2528
foreman_proxy::plugin::module { 'container_gateway':
2629
version => $version,

spec/classes/foreman_proxy__plugin__container_gateway_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@
2222
let :params do {
2323
:pulp_endpoint => 'https://test.example.com',
2424
:sqlite_db_path => '/dev/null.db',
25+
:sqlite_timeout => 12345,
2526
} end
2627

2728
it 'container_gateway.yml should contain the correct configuration' do
2829
verify_exact_contents(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml', [
2930
'---',
3031
':enabled: https',
3132
':pulp_endpoint: https://test.example.com',
32-
':sqlite_db_path: /dev/null.db'
33+
':sqlite_db_path: /dev/null.db',
34+
':sqlite_timeout: 12345'
3335
])
3436
end
3537
end

templates/plugin/container_gateway.yml.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
:enabled: <%= @module_enabled %>
44
:pulp_endpoint: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::pulp_endpoint") %>
55
:sqlite_db_path: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_db_path") %>
6+
<% if scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_timeout") -%>
7+
:sqlite_timeout: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_timeout") %>
8+
<% end -%>

0 commit comments

Comments
 (0)