mirror of https://gitee.com/bigwinds/arangodb
Make global ArangoClusterComm object in each thread.
This commit is contained in:
parent
bbf28e3501
commit
11e018e6b2
|
@ -1339,15 +1339,15 @@ void TRI_InitV8Cluster (v8::Handle<v8::Context> context) {
|
|||
TRI_AddMethodVocbase(rt, "drop", JS_Drop);
|
||||
#endif
|
||||
|
||||
v8g->ServerStateTempl = v8::Persistent<v8::ObjectTemplate>::New(isolate, rt);
|
||||
TRI_AddGlobalFunctionVocbase(context, "ArangoClusterComm",
|
||||
v8g->ClusterCommTempl = v8::Persistent<v8::ObjectTemplate>::New(isolate, rt);
|
||||
TRI_AddGlobalFunctionVocbase(context, "ArangoClusterCommCtor",
|
||||
ft->GetFunction());
|
||||
|
||||
// register the global object
|
||||
//v8::Handle<v8::Object> ss = v8g->ClusterCommTempl->NewInstance();
|
||||
//if (! ss.IsEmpty()) {
|
||||
// TRI_AddGlobalVariableVocbase(context, "ArangoServerState", ss);
|
||||
// }
|
||||
ss = v8g->ClusterCommTempl->NewInstance();
|
||||
if (! ss.IsEmpty()) {
|
||||
TRI_AddGlobalVariableVocbase(context, "ArangoServerState", ss);
|
||||
}
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
|
|
|
@ -43,6 +43,7 @@ TRI_v8_global_s::TRI_v8_global_s (v8::Isolate* isolate)
|
|||
AgencyTempl(),
|
||||
ClusterInfoTempl(),
|
||||
ServerStateTempl(),
|
||||
ClusterCommTempl(),
|
||||
#endif
|
||||
ErrorTempl(),
|
||||
GeneralCursorTempl(),
|
||||
|
|
Loading…
Reference in New Issue