bus: remove legacy import * usage support

This commit is contained in:
undefined committed 2025-03-04 09:55:05 +08:00
1 parent bd63331137
commit aeb9d4cf50
17 files changed
+16 -24

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ import storage from '../model/storage';
import * as system from '../model/system';
import task, { Consumer } from '../model/task';
import user from '../model/user';
import * as bus from '../service/bus';
import bus from '../service/bus';
import { updateJudge } from '../service/monitor';
import {
ConnectionHandler, Handler, post, subscribe, Types,
+1 -1
View File
@@ -9,7 +9,7 @@ import {
BaseUserDict, ContestRule, ContestRules, ProblemDict, RecordDoc,
ScoreboardConfig, ScoreboardNode, ScoreboardRow, SubtaskResult, Tdoc,
} from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import type { Handler } from '../service/server';
import { Optional } from '../typeutils';
+1 -1
View File
@@ -5,7 +5,7 @@ import { DiscussionNodeNotFoundError, DocumentNotFoundError } from '../error';
import {
DiscussionHistoryDoc, DiscussionReplyDoc, DiscussionTailReplyDoc, Document,
} from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import { NumberKeys } from '../typeutils';
import { buildProjection } from '../utils';
+1 -1
View File
@@ -9,7 +9,7 @@ import {
DiscussionReplyDoc, ProblemDoc, ProblemStatusDoc,
Tdoc, TrainingDoc,
} from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import { ArrayKeys, MaybeArray, NumberKeys, Projection } from '../typeutils';
import { buildProjection } from '../utils';
+1 -1
View File
@@ -2,7 +2,7 @@ import { Dictionary, escapeRegExp } from 'lodash';
import { LRUCache } from 'lru-cache';
import { Filter } from 'mongodb';
import { DomainDoc } from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import { MaybeArray, NumberKeys } from '../typeutils';
import { ArgMethod } from '../utils';
+1 -1
View File
@@ -1,6 +1,6 @@
import { Filter, ObjectId } from 'mongodb';
import { MessageDoc } from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import { ArgMethod } from '../utils';
import { PRIV } from './builtin';
+1 -1
View File
@@ -1,7 +1,7 @@
import { cloneDeep } from 'lodash';
import { ObjectId } from 'mongodb';
import { OplogDoc } from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import type { Handler } from '../service/server';
+1 -1
View File
@@ -16,7 +16,7 @@ import type {
Document, ProblemDict, ProblemStatusDoc, User,
} from '../interface';
import { parseConfig } from '../lib/testdataConfig';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import {
ArrayKeys, MaybeArray, NumberKeys, Projection,
+1 -1
View File
@@ -1,6 +1,6 @@
import { ObjectId } from 'mongodb';
import { SolutionNotFoundError } from '../error';
import * as bus from '../service/bus';
import bus from '../service/bus';
import * as document from './document';
class SolutionModel {
+1 -1
View File
@@ -1,5 +1,5 @@
import { SystemKeys } from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import { NumberKeys } from '../typeutils';
import { SYSTEM_SETTINGS } from './setting';
+1 -1
View File
@@ -6,7 +6,7 @@ import { sleep } from '@hydrooj/utils/lib/utils';
import { Context } from '../context';
import { EventDoc, Task } from '../interface';
import { Logger } from '../logger';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
const logger = new Logger('model/task');
+1 -1
View File
@@ -1,6 +1,6 @@
import { Filter } from 'mongodb';
import { TokenDoc } from '../interface';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import { ArgMethod } from '../utils';
+1 -1
View File
@@ -9,7 +9,7 @@ import {
} from '../interface';
import avatar from '../lib/avatar';
import pwhash from '../lib/hash.hydro';
import * as bus from '../service/bus';
import bus from '../service/bus';
import db from '../service/db';
import { Value } from '../typeutils';
import { ArgMethod, buildProjection } from '../utils';
-8
View File
@@ -114,14 +114,6 @@ export function apply(ctx: Context) {
}
export default app;
export const on = (a, b, c?) => app.on(a, b, c);
export const once = (a, b, c?) => app.once(a, b, c);
export const parallel = app.parallel.bind(app);
export const emit = app.parallel.bind(app);
export const bail = app.bail.bind(app);
// For backward compatibility
export const serial: any = app.parallel.bind(app);
export const broadcast = app.broadcast.bind(app);
global.Hydro.service.bus = app as any;
global.bus = app;
+1 -1
View File
@@ -7,7 +7,7 @@ import { Time } from '@hydrooj/utils';
import { ValidationError } from '../error';
import { Logger } from '../logger';
import { load } from '../options';
import * as bus from './bus';
import bus from './bus';
const logger = new Logger('mongo');
export interface Collections { }
+1 -1
View File
@@ -4,7 +4,7 @@ import type { StatusUpdate } from '@hydrooj/utils/lib/sysinfo';
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
import { Context } from '../context';
import { Logger } from '../logger';
import * as bus from './bus';
import bus from './bus';
import db from './db';
const coll = db.collection('status');
+1 -1
View File
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-shadow */
import { Logger } from './logger';
import * as bus from './service/bus';
import bus from './service/bus';
let terminating = false;
async function terminate() {