You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when the client has the option "autoReconnect" set to true, the method "handleDisconnect" creates a new connection as shown in the code below:
functionhandleDisconnect(client){schema.client.on('error',function(error){if(error.code!=='PROTOCOL_CONNECTION_LOST')throwerror;console.log('> Re-connecting lost MySQL connection: '+error.stack);if(s.pool){schema.client=mysql.createPool(conSettings);schema.client.getConnection(function(err,connection){if(err){thrownewError(err);}});schema.adapter=newMySQL(schema.client,conSettings);schema.adapter.schema=schema;schema.client.once('connection',function(connection){startAdapter(schema,dbName,callback);});handleDisconnect(schema.client);}else{schema.client=mysql.createConnection(conSettings);schema.adapter=newMySQL(schema.client,conSettings);schema.adapter.schema=schema;startAdapter(schema,dbName,callback);handleDisconnect(schema.client);}});}
When the adapter creates a new istance of the MySQL prototype it will reset the models structure:
when the client has the option "autoReconnect" set to true, the method "handleDisconnect" creates a new connection as shown in the code below:
When the adapter creates a new istance of the MySQL prototype it will reset the models structure:
This means the client won't be usable anymore unless you re-initialize all the models again manually.
The text was updated successfully, but these errors were encountered: