workspace: bump package version

This commit is contained in:
undefined committed 2022-10-05 20:16:39 +08:00
1 parent bb288cb960
commit c394378dba
22 files changed
+32 -42

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ import {
Context, DomainModel, iterateAllProblem, iterateAllProblemInDomain,
Logger, Schema, SystemModel,
} from 'hydrooj';
import * as SonicService from './service';
import { SonicService } from './service';
const logger = new Logger('sonic');
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/sonic",
"version": "1.2.7",
"version": "1.3.0",
"description": "Sonic search service",
"main": "index.ts",
"preferUnplugged": true,
+5 -9
View File
@@ -40,11 +40,15 @@ function getHandler(type: string, that: any) {
};
}
class SonicService extends Service {
export class SonicService extends Service {
public search: Search;
public ingest: Ingest;
public error = '';
constructor(ctx: Context) {
super(ctx, 'sonic', true);
}
async start() {
const [host, port, auth] = SystemModel.getMany(['sonic.host', 'sonic.port', 'sonic.auth']);
const cfg = {
@@ -54,10 +58,6 @@ class SonicService extends Service {
};
this.search = new Search(cfg);
this.ingest = new Ingest(cfg);
await this.connect();
}
async connect() {
try {
this.search.connect(getHandler('search', this));
this.ingest.connect(getHandler('ingest', this));
@@ -107,7 +107,3 @@ class SonicService extends Service {
]);
}
}
export function apply() {
Context.service('sonic', SonicService);
}