Skip to content

Commit

Permalink
Parse lockId as invariant (#13284)
Browse files Browse the repository at this point in the history
Co-authored-by: Zeegaan <nge@umbraco.dk>
(cherry picked from commit 272e922)
  • Loading branch information
Zeegaan authored and nul800sebastiaan committed Oct 25, 2022
1 parent de2a927 commit e7fae14
Showing 1 changed file with 2 additions and 1 deletion.
@@ -1,5 +1,6 @@
using System.Data;
using System.Data.Common;
using System.Globalization;
using Microsoft.Data.SqlClient;
using Microsoft.Data.Sqlite;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -142,7 +143,7 @@ private void ObtainWriteLock()
"SqliteDistributedLockingMechanism requires a transaction to function.");
}

var query = @$"UPDATE umbracoLock SET value = (CASE WHEN (value=1) THEN -1 ELSE 1 END) WHERE id = {LockId}";
var query = @$"UPDATE umbracoLock SET value = (CASE WHEN (value=1) THEN -1 ELSE 1 END) WHERE id = {LockId.ToString(CultureInfo.InvariantCulture)}";

DbCommand command = db.CreateCommand(db.Connection, CommandType.Text, query);

Expand Down

0 comments on commit e7fae14

Please sign in to comment.