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

Please any example using node-pool #107

Open
nvcken opened this issue Dec 24, 2014 · 0 comments
Open

Please any example using node-pool #107

nvcken opened this issue Dec 24, 2014 · 0 comments

Comments

@nvcken
Copy link

nvcken commented Dec 24, 2014

My implement below, but not work
database.json

"dev": {
        "driver": "mysql",
        "host" : "203.162.69.13",
        "port" : "3306",
        "user": "smilee",
        "password": "123456",
        "database": "bingota_web_noel",
        "pooling": {
          "name": "mysql_pool"
        }
    },
var poolModule = require('generic-pool');
    var pool = poolModule.Pool({
        name     : 'mysql_pool',
        create   : function(callback) {
            var Client = require('mysql').Client;
            var c = new Client();
            c.user     = 'smilee';
            c.password = '123456';
            c.database = 'bingota_web_noel';
            c.connect();

            // parameter order: err, resource
            // new in 1.0.6
            callback(null, c);
        },
        destroy  : function(client) { client.end(); },
        max      : 10,
        // specifies how long a resource can stay idle in pool before being removed
        idleTimeoutMillis : 30000,
         // if true, logs via console.log - can also be a function
        log : true 
    });
persist.env = 'dev';
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

1 participant