Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julian Bouzas
WirePlumber
Commits
ca7109b3
Commit
ca7109b3
authored
Nov 07, 2021
by
Julian Bouzas
Committed by
George Kiagiadakis
Nov 09, 2021
Browse files
policy-node: add check to not relink more than 5 times if link with peer fails
parent
d47df77c
Pipeline
#442605
passed with stages
in 2 minutes and 7 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/scripts/policy-node.lua
View file @
ca7109b3
...
...
@@ -24,6 +24,15 @@ function createLink (si, si_target, passthrough, exclusive)
local
si_props
=
si
.
properties
local
target_props
=
si_target
.
properties
-- break rescan if tried more than 5 times with same target
if
si_flags
[
si
.
id
].
failed_peer_id
~=
nil
and
si_flags
[
si
.
id
].
failed_peer_id
==
si_target
.
id
and
si_flags
[
si
.
id
].
failed_count
~=
nil
and
si_flags
[
si
.
id
].
failed_count
>
5
then
Log
.
warning
(
si
,
"tried to link on last rescan, not retrying"
)
return
end
if
si_props
[
"item.node.direction"
]
==
"output"
then
-- playback
out_item
=
si
...
...
@@ -61,6 +70,12 @@ function createLink (si, si_target, passthrough, exclusive)
-- register
si_flags
[
si
.
id
].
peer_id
=
si_target
.
id
si_flags
[
si
.
id
].
failed_peer_id
=
si_target
.
id
if
si_flags
[
si
.
id
].
failed_count
~=
nil
then
si_flags
[
si
.
id
].
failed_count
=
si_flags
[
si
.
id
].
failed_count
+
1
else
si_flags
[
si
.
id
].
failed_count
=
1
end
si_link
:
register
()
-- activate
...
...
@@ -70,6 +85,8 @@ function createLink (si, si_target, passthrough, exclusive)
si_flags
[
si
.
id
].
peer_id
=
nil
l
:
remove
()
else
si_flags
[
si
.
id
].
failed_peer_id
=
nil
si_flags
[
si
.
id
].
failed_count
=
0
Log
.
info
(
l
,
"activated si-standard-link"
)
end
end
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment