@@ -2,10 +2,13 @@ package eu.pretix.libpretixsync.sync
22
33import app.cash.sqldelight.TransactionWithoutReturn
44import app.cash.sqldelight.db.QueryResult
5+ import eu.pretix.libpretixsync.SentryInterface
56import eu.pretix.libpretixsync.api.PretixApi
67import eu.pretix.libpretixsync.sqldelight.CheckInList
78import eu.pretix.libpretixsync.sqldelight.Migrations
89import eu.pretix.libpretixsync.sqldelight.SyncDatabase
10+ import eu.pretix.libpretixsync.sqldelight.writeTransaction
11+ import eu.pretix.libpretixsync.sqldelight.writeTransactionWithResult
912import eu.pretix.libpretixsync.sync.SyncManager.ProgressFeedback
1013import eu.pretix.libpretixsync.utils.JSONUtils
1114import org.json.JSONException
@@ -19,6 +22,7 @@ class CheckInListSyncAdapter(
1922 syncCycleId : String ,
2023 feedback : ProgressFeedback ? ,
2124 private val subeventId : Long? ,
25+ private val sentry : SentryInterface ? = null ,
2226) : BaseConditionalSyncAdapter<CheckInList, Long>(
2327 db = db,
2428 fileStorage = fileStorage,
@@ -68,7 +72,9 @@ class CheckInListSyncAdapter(
6872 }
6973
7074 override fun insert (jsonobj : JSONObject ) {
71- val listId = db.checkInListQueries.transactionWithResult {
75+ // Called from within transaction in processPage
76+ // Set noEnclosing=false but keep transaction if this ever gets called directly
77+ val listId = db.checkInListQueries.writeTransactionWithResult(db, sentry, false ) {
7278 db.checkInListQueries.insert(
7379 all_items = jsonobj.optBoolean(" all_products" ),
7480 event_slug = eventSlug,
@@ -143,7 +149,7 @@ class CheckInListSyncAdapter(
143149 }
144150
145151 override fun runInTransaction (body : TransactionWithoutReturn .() -> Unit ) {
146- db.checkInListQueries.transaction( false , body)
152+ db.checkInListQueries.writeTransaction(db = db, sentry = sentry, body = body)
147153 }
148154
149155 override fun runBatch (parameterBatch : List <Long >): List <CheckInList > =
0 commit comments