Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
dc8fbae9
Commit
dc8fbae9
authored
Aug 25, 2016
by
Hugo Beauzée-Luyssen
Browse files
SqliteTools: Don't retry forever when the db is busy
parent
2d69edad
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/database/SqliteTools.h
View file @
dc8fbae9
...
@@ -146,6 +146,7 @@ public:
...
@@ -146,6 +146,7 @@ public:
Row
row
()
Row
row
()
{
{
auto
maxRetries
=
10
;
while
(
true
)
while
(
true
)
{
{
auto
res
=
sqlite3_step
(
m_stmt
.
get
()
);
auto
res
=
sqlite3_step
(
m_stmt
.
get
()
);
...
@@ -154,7 +155,7 @@ public:
...
@@ -154,7 +155,7 @@ public:
else
if
(
res
==
SQLITE_DONE
)
else
if
(
res
==
SQLITE_DONE
)
return
Row
();
return
Row
();
else
if
(
res
==
SQLITE_BUSY
&&
(
Transaction
::
transactionInProgress
()
==
false
||
else
if
(
res
==
SQLITE_BUSY
&&
(
Transaction
::
transactionInProgress
()
==
false
||
m_isCommit
==
true
)
)
m_isCommit
==
true
)
&&
maxRetries
--
>
0
)
continue
;
continue
;
std
::
string
errMsg
=
sqlite3_errmsg
(
m_dbConn
);
std
::
string
errMsg
=
sqlite3_errmsg
(
m_dbConn
);
switch
(
res
)
switch
(
res
)
...
...
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