Skip to content

Commit 458b7d9

Browse files
committed
0.4.1
1 parent 4507244 commit 458b7d9

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ It's ok you can do whatever you need. I add log options for some technical infor
172172

173173
##Changelog
174174

175+
###0.4.1
176+
177+
Add clear schema cache on change schema id
178+
175179
###0.4.0
176180

177181
Change msgpack5 to msgpack-lite(thx to @arusakov).

lib/connection.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function TarantoolConnection (options){
5656
readable: true,
5757
writable: true
5858
});
59+
this.schemaId = null;
5960
this.msgpack = options.msgpack || msgpack;
6061
this.state = states.INITED;
6162
this.options = _.extend({}, defaultOptions, options);
@@ -243,6 +244,19 @@ TarantoolConnection.prototype._processResponse = function(buffer){
243244
var obj = this.msgpack.decode(dataBuffer);
244245

245246
var reqId = obj[0][1];
247+
if (this.schemaId)
248+
{
249+
if (this.schemaId != obj[0][5])
250+
{
251+
this.schemaId = obj[0][5];
252+
//clear cache for naming
253+
this.namespace = {};
254+
}
255+
}
256+
else
257+
{
258+
this.schemaId = obj[0][5];
259+
}
246260
for(var i = 0; i<this.commandsQueue.length; i++)
247261
if (this.commandsQueue[i][1] == reqId)
248262
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tarantool-driver",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Tarantool driver for 1.6",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)