From e034d330def53e5ac3df50000a5096910e289689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthieu=20Barth=C3=A9lemy?= Date: Tue, 7 Apr 2020 08:57:23 +0800 Subject: [PATCH] fix ignored useSoftDeletes option --- Sources/QueuesFluentDriver/FluentQueue.swift | 2 +- Sources/QueuesFluentDriver/FluentQueuesDriver.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/QueuesFluentDriver/FluentQueue.swift b/Sources/QueuesFluentDriver/FluentQueue.swift index fabea20..393e959 100644 --- a/Sources/QueuesFluentDriver/FluentQueue.swift +++ b/Sources/QueuesFluentDriver/FluentQueue.swift @@ -7,7 +7,7 @@ struct FluentQueue { let db: Database? let context: QueueContext let dbType: QueuesFluentDbType - let useSoftDeletes: Bool = true + let useSoftDeletes: Bool static let model = JobModel(id: UUID.generateRandom(), key: "") } diff --git a/Sources/QueuesFluentDriver/FluentQueuesDriver.swift b/Sources/QueuesFluentDriver/FluentQueuesDriver.swift index edfa5ee..a26d408 100644 --- a/Sources/QueuesFluentDriver/FluentQueuesDriver.swift +++ b/Sources/QueuesFluentDriver/FluentQueuesDriver.swift @@ -2,7 +2,6 @@ import Fluent import SQLKit import Queues - public enum QueuesFluentDbType: String { case postgresql case mysql @@ -30,7 +29,8 @@ extension FluentQueuesDriver: QueuesDriver { return FluentQueue( db: db, context: context, - dbType: QueuesFluentDbType(rawValue: (db as! SQLDatabase).dialect.name)! + dbType: QueuesFluentDbType(rawValue: (db as! SQLDatabase).dialect.name)!, + useSoftDeletes: self.useSoftDeletes ) }