Skip to content

Commit

Permalink
Use registerServiceConnector instead of directly pushing service conn…
Browse files Browse the repository at this point in the history
…ectors

- package.json: Bumped to 4.0.1
  • Loading branch information
kfitzgerald committed Mar 29, 2022
1 parent 07a94ff commit 7729db3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions RedisService.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ class RedisService {
if (callback) callback(err); // constructor callback
});
} else {
app._serviceConnectors.push(new Promise((resolve) => {
console.log('starting redis')
this.connect(() => {
if (callback) callback(); // constructor callback
resolve();
app.registerServiceConnector(async () => {
new Promise((resolve) => {
this.connect(() => {
if (callback) callback(); // constructor callback
resolve();
});
});
}));
});
}

}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "okanjo-app-redis",
"version": "4.0.0",
"version": "4.0.1",
"description": "Service for interfacing with Redis",
"main": "RedisService.js",
"scripts": {
Expand Down

0 comments on commit 7729db3

Please sign in to comment.