Skip to content

Commit

Permalink
pass specs through thread instead of redis
Browse files Browse the repository at this point in the history
  • Loading branch information
rjawesome committed May 16, 2024
1 parent b0b14d0 commit 91e398a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
import { QueryHandlerOptions } from '@biothings-explorer/types';
import BTEGraph from './graph/graph';
import QEdge from './query_edge';
import { redisClient } from '@biothings-explorer/utils';
import { Telemetry } from '@biothings-explorer/utils';

// Exports for external availability
Expand Down Expand Up @@ -75,16 +74,11 @@ export default class TRAPIQueryHandler {
const configListAPIs = this.options.apiList['include'];

let smartapiRegistry;
if (redisClient.clientEnabled) {
const redisData = await redisClient.client.getTimeout(`bte:smartapi:specs`)
if (redisData) {
smartapiRegistry = JSON.parse(redisData);
}
}

if (!smartapiRegistry) {
const file = await fs.readFile(this.path, "utf-8");
smartapiRegistry = JSON.parse(file);
if (this.options.smartapi) {
smartapiRegistry = this.options.smartapi;
} else {
const file = await fs.readFile(this.path, "utf-8");
smartapiRegistry = JSON.parse(file);
}

const smartapiIds: string[] = [];
Expand Down Expand Up @@ -113,7 +107,8 @@ export default class TRAPIQueryHandler {
`Query options are: ${JSON.stringify({
...this.options,
schema: this.options.schema ? this.options.schema.info.version : 'not included',
metakg: ""
metakg: "",
smartapi: ""
})}`,
);

Expand Down

0 comments on commit 91e398a

Please sign in to comment.