mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-01-16 13:00:34 +00:00
Compare commits
No commits in common. "41d8dbad5de499a8f7b54156bb17ebd0099df924" and "c3834ca400e772c74bff24de505df55fb05f1f4a" have entirely different histories.
41d8dbad5d
...
c3834ca400
@ -86,8 +86,11 @@ def cqi_over_sio(fn_name: str, fn_args: Dict = {}):
|
||||
cqi_client_lock.acquire()
|
||||
try:
|
||||
fn_return_value = fn(**fn_args)
|
||||
except BrokenPipeError as e:
|
||||
return {'code': 500, 'msg': 'Internal Server Error'}
|
||||
except BrokenPipeError:
|
||||
fn_return_value = {
|
||||
'code': 500,
|
||||
'msg': 'Internal Server Error'
|
||||
}
|
||||
except CQiException as e:
|
||||
return {
|
||||
'code': 502,
|
||||
|
@ -630,9 +630,7 @@ cqi.api.APIClient = class APIClient {
|
||||
async ext_corpus_static_data(corpus) {
|
||||
const fn_name = 'ext_corpus_static_data';
|
||||
const fn_args = {corpus: corpus};
|
||||
let compressedEncodedData = await this.#request(fn_name, fn_args);
|
||||
let data = pako.inflate(compressedEncodedData, {to: 'string'});
|
||||
return JSON.parse(data);
|
||||
return await this.#request(fn_name, fn_args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +138,15 @@ cqi.models.corpora.CorpusCollection = class CorpusCollection extends cqi.models.
|
||||
/************************************************************************
|
||||
* Custom additions for nopaque *
|
||||
************************************************************************/
|
||||
returnValue.static_data = await this.client.api.ext_corpus_static_data(corpusName);
|
||||
// returnValue.static_data = await this.client.api.ext_corpus_static_data(corpusName);
|
||||
let tmp = await this.client.api.ext_corpus_static_data(corpusName);
|
||||
console.log(tmp);
|
||||
let inflated = pako.inflate(tmp);
|
||||
console.log(inflated);
|
||||
let decoder = new TextDecoder('utf-8');
|
||||
console.log(decoder);
|
||||
let decoded = decoder.decode(inflated);
|
||||
returnValue.static_data = JSON.parse(decoded);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user