Skip to content

Commit

Permalink
add debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmcd committed Mar 8, 2019
1 parent a3da344 commit 0985e99
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
20 changes: 10 additions & 10 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/vapor/core.git",
"state": {
"branch": null,
"revision": "1794ff138bd669175a2528d27695028d7cb30471",
"version": "3.5.0"
"revision": "439d6dcd6c520451ae30d39b2ca9f2aba96c22f4",
"version": "3.7.0"
}
},
{
Expand Down Expand Up @@ -69,17 +69,17 @@
"repositoryURL": "https://github.com/vapor/redis.git",
"state": {
"branch": null,
"revision": "b14ae4174ee4c8d2bb9196c96144b591c5a6592a",
"version": "3.1.0"
"revision": "ab229d186694e6ea64d9e92e8bab28304f92df3c",
"version": "3.3.0"
}
},
{
"package": "Routing",
"repositoryURL": "https://github.com/vapor/routing.git",
"state": {
"branch": null,
"revision": "3219e328491b0853b8554c5a694add344d2c6cfb",
"version": "3.0.1"
"revision": "626190ddd2bd9f967743b60ba6adaf90bbd2651c",
"version": "3.0.2"
}
},
{
Expand All @@ -96,8 +96,8 @@
"repositoryURL": "https://github.com/apple/swift-nio.git",
"state": {
"branch": null,
"revision": "98434c1f1d687ff5a24d2cabfbd19b5c7d2d7a2f",
"version": "1.13.0"
"revision": "87dbd0216c47ea2e7ddb1b545271b716e03b943e",
"version": "1.13.1"
}
},
{
Expand Down Expand Up @@ -159,8 +159,8 @@
"repositoryURL": "https://github.com/vapor/vapor.git",
"state": {
"branch": null,
"revision": "6c7284681c3432fee29c268babf954be6816cbfb",
"version": "3.2.2"
"revision": "c86ada59b31c69f08a6abd4f776537cba48d5df6",
"version": "3.3.0"
}
},
{
Expand Down
10 changes: 8 additions & 2 deletions Sources/JobsRedisDriver/JobsRedisDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ extension JobsRedisDriver: JobsPersistenceLayer {
return conn.rpoplpush(source: key, destination: processing).and(result: conn)
}.flatMap(to: (RedisData, RedisClient).self) { redisData, conn in
guard let id = redisData.string else {
print("Could not convert ID data to string")
conn.close()
throw Abort(.internalServerError)
}
Expand All @@ -42,10 +43,15 @@ extension JobsRedisDriver: JobsPersistenceLayer {
}.map { redisData, conn in
conn.close()

guard let data = redisData.data else { return nil }
guard let data = redisData.data else {
print("Could not convert redis data to Data")
return nil
}

let decoder = try JSONDecoder().decode(DecoderUnwrapper.self, from: data)
return try JobStorage(from: decoder.decoder)
}.catchMap { _ in
}.catchMap { error in
print("Error getting data: \(error)")
return nil
}
}
Expand Down

0 comments on commit 0985e99

Please sign in to comment.