Skip to content

Commit

Permalink
FUCKING Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
m-barthelemy committed Apr 4, 2020
1 parent 39605ea commit c7fa7af
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Sources/QueuesFluentDriver/FluentQueue.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import Foundation
import Queues
import Fluent
import FluentKit
import SQLKit

import FluentMySQLDriver
import FluentPostgresDriver

struct FluentQueue {
let database: Database
let context: QueueContext
Expand Down Expand Up @@ -119,7 +115,6 @@ extension FluentQueue: Queue {
}
}


}

enum QueuesFluentError: Error {
Expand Down
54 changes: 54 additions & 0 deletions Sources/QueuesFluentDriver/JobModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import Foundation
import Fluent

enum JobState: String, Codable, CaseIterable {
/// Job created but should NOT be picked up for execution yet
case initial
/// Ready to be oicked up for execution
case pending
case processing
/// Executed, regardless if it was successful or not
case completed
}

class JobModel: Model {
public required init() {}

/// Properties
public static var schema = "jobs"

/// The unique Job uuid
@ID(key: .id)
public var id: UUID?

/// The Job key
@Field(key: "key")
var key: String

/// The Job data
@Field(key: "data")
var data: Data

/// The current state of the Job
@Field(key: "state")
var state: JobState

/// The created timestamp
@Timestamp(key: "created_at", on: .create)
var createdAt: Date?

/// The updated timestamp
@Timestamp(key: "updated_at", on: .update)
var updatedAt: Date?

@Timestamp(key: "deleted_at", on: .delete)
var deletedAt: Date?


init(id: UUID, key: String, data: Data) {
self.id = id
self.key = key
self.data = data
self.state = .initial
}
}

0 comments on commit c7fa7af

Please sign in to comment.