diff --git a/README.md b/README.md index 10dd6ec..fc977a3 100644 --- a/README.md +++ b/README.md @@ -37,16 +37,16 @@ class MongoDbPool extends ConnectionPool { /** * Retrieve and release a connection from the pool. */ -app.Interceptor(r'/.*') -dbInterceptor(MongoDbPool pool) { +@app.Interceptor(r'/.*') +dbInterceptor(@app.Inject() MongoDbPool pool) { //get a connection - pool.getConnection().then((managedConnection) { + return pool.getConnection().then((managedConnection) { //save the connection in the attributes map app.request.attributes["conn"] = managedConnection.conn; - app.chain.next(() { + return app.chain.next(() { if (app.chain.error is ConnectionException) { //if a connection is lost, mark it as invalid, so the pool can reopen it //in the next request