|
@@ -31,7 +31,6 @@ export async function resolveJob(job: Job): Promise<CifWriter.Encoder<any>> {
|
|
|
const wrappedStructure = await getStructure(job);
|
|
|
|
|
|
try {
|
|
|
- const encoder = CifWriter.createEncoder({ binary: job.responseFormat.isBinary, encoderName: `ModelServer ${Version}` });
|
|
|
perf.start('query');
|
|
|
const structure = job.queryDefinition.structureTransform
|
|
|
? await job.queryDefinition.structureTransform(job.normalizedParams, wrappedStructure.structure)
|
|
@@ -40,6 +39,13 @@ export async function resolveJob(job: Job): Promise<CifWriter.Encoder<any>> {
|
|
|
const result = await StructureSelection.unionStructure(StructureQuery.run(query, structure, Config.maxQueryTimeInMs));
|
|
|
perf.end('query');
|
|
|
|
|
|
+ const encoder = CifWriter.createEncoder({
|
|
|
+ binary: job.responseFormat.isBinary,
|
|
|
+ encoderName: `ModelServer ${Version}`,
|
|
|
+ binaryEncodingPovider: getEncodingProvider(wrappedStructure),
|
|
|
+ binaryAutoClassifyEncoding: true
|
|
|
+ });
|
|
|
+
|
|
|
ConsoleLogger.logId(job.id, 'Query', 'Query finished.');
|
|
|
|
|
|
perf.start('encode');
|
|
@@ -68,6 +74,11 @@ export async function resolveJob(job: Job): Promise<CifWriter.Encoder<any>> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function getEncodingProvider(structure: StructureWrapper) {
|
|
|
+ if (!structure.isBinary) return void 0;
|
|
|
+ return CifWriter.createEncodingProviderFromCifFrame(structure.cifFrame);
|
|
|
+}
|
|
|
+
|
|
|
function doError(job: Job, e: any) {
|
|
|
const encoder = CifWriter.createEncoder({ binary: job.responseFormat.isBinary, encoderName: `ModelServer ${Version}` });
|
|
|
encoder.writeCategory(_model_server_result, [job]);
|