Skip to content
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

Commit 83562b4

Browse files
Remove canceler ffi
Use the default nonCanceler function to handle the inability to cancel mongo queries.
1 parent 00ab644 commit 83562b4

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/Database/Mongo/Mongo.purs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Database.Mongo.Mongo
1717
, updateMany, updateMany'
1818
) where
1919

20-
import Control.Monad.Aff (Aff(), makeAff, makeAff', Canceler(..))
20+
import Control.Monad.Aff (Aff(), makeAff, makeAff', Canceler(..), nonCanceler)
2121
import Control.Monad.Eff (Eff())
2222
import Control.Monad.Eff.Class
2323
import Control.Monad.Eff.Exception (Error(), error)
@@ -263,7 +263,7 @@ updateMany' s j o c eb cb = runFn8 _update fnTypeMany (printBson s) j' o' c igno
263263

264264
-- | Always ignore the cancel.
265265
ignoreCancel :: forall e a. a -> Canceler (db :: DB | e)
266-
ignoreCancel c = Canceler \err -> makeAff (\eb cb -> runFn4 _ignoreCancel c err eb cb)
266+
ignoreCancel _ = nonCanceler
267267

268268
-- | foreign imports
269269
foreign import _connect
@@ -436,17 +436,3 @@ foreign import _update
436436
(Error -> Eff (db :: DB | e) Unit)
437437
(Json -> Eff (db :: DB | e) Unit)
438438
(Eff (db :: DB | e) (Canceler (db :: DB | e)))
439-
440-
foreign import _ignoreCancel
441-
"""
442-
function _ignoreCancel(any, cancelError, errback, callback) {
443-
return function() {
444-
return callback(false)();
445-
};
446-
}
447-
""" :: forall e a. Fn4
448-
a
449-
Error
450-
(Error -> Eff (db :: DB | e) Unit)
451-
(Boolean -> Eff (db :: DB | e) Unit)
452-
(Eff (db :: DB | e) Unit)

0 commit comments

Comments
 (0)