Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove Redis and Mongo Dependencies #33

Open
rjdjohnston opened this issue Aug 19, 2019 · 3 comments
Open

How to remove Redis and Mongo Dependencies #33

rjdjohnston opened this issue Aug 19, 2019 · 3 comments

Comments

@rjdjohnston
Copy link

Hello,

This is a great api boilerplate. My use case requires removing the queue/redis and mongo dependencies

From what I can tell, there is no way easy way to completely remove redis or mongo from the app.

Any help/guidance you can give would be greatly appreciated.

@iolufemi
Copy link
Owner

iolufemi commented Apr 30, 2020

Sorry for the late response.

If you still need this, you can comment out the dependencies in the database service file here services/database/index.js

The queue is also inactive by default until you start it via npm run workers

@razzul
Copy link

razzul commented Jun 6, 2020

var databases = {
    // logMongo: require('./logMongo'),
    // mongo: require('./mongo'),
    redis: require('./redis'),
    // api: require('./api'),
    sql: require('./sql')
};```

I tried but its not working still getting error 


`C:\work\n-power-chat-bot>gulp
[13:17:51] Using gulpfile C:\work\n-power-chat-bot\gulpfile.js
[13:17:51] Starting 'default'...
[13:17:51] [nodemon] 2.0.3
[13:17:51] [nodemon] to restart at any time, enter `rs`
[13:17:51] [nodemon] watching path(s): *.*
[13:17:51] [nodemon] watching extensions: js,mjs,json
[13:17:51] [nodemon] starting `node app.js`
C:\work\n-power-chat-bot\services\queue\Model.js:25
        type: db._mongoose.Schema.Types.Mixed
                 ^

TypeError: Cannot read property '_mongoose' of undefined
    at Object.<anonymous> (C:\work\n-power-chat-bot\services\queue\Model.js:25:18)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\services\queue\index.js:8:13)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\models\Organisations.js:4:13)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\work\n-power-chat-bot\models\index.js:22:36
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (C:\work\n-power-chat-bot\models\index.js:18:7)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\routes\index.js:21:19)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\app.js:38:18)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
[13:17:53] running tasks...`

@iolufemi
Copy link
Owner

The queue and the request logs still depend on Mongo for the scheduler. Removing Mongo it'll break the scheduler. Leave the logMongo active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants