Skip to content

Commit 8096df4

Browse files
committed
judge: add warning for no host configured
1 parent 4a372ea commit 8096df4

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/hydrojudge/src/daemon.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import './utils';
1515

1616
import PQueue from 'p-queue';
17-
import { fs } from '@hydrooj/utils';
17+
import { fs, Time } from '@hydrooj/utils';
1818
import { getConfig } from './config';
1919
import HydroHost from './hosts/hydro';
2020
import Vj4Host from './hosts/vj4';
@@ -53,6 +53,10 @@ async function daemon() {
5353
const queue = new PQueue({ concurrency: Infinity });
5454
await fs.ensureDir(getConfig('tmp_dir'));
5555
queue.on('error', (e) => log.error(e));
56+
if (!Object.keys(_hosts).length) {
57+
log.warn('No host configured');
58+
setInterval(() => log.warn('No host configured'), Time.hour);
59+
}
5660
for (const i in _hosts) {
5761
_hosts[i].host ||= i;
5862
hosts[i] = _hosts[i].type === 'vj4' ? new Vj4Host(_hosts[i]) : new HydroHost(_hosts[i]);

packages/ui-default/components/datepicker/datepicker.page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function initTimePicker(input: HTMLInputElement) {
4141
}).on('mousedown', (e) => {
4242
e.preventDefault();
4343
$input.val(time).trigger('change');
44-
closeDropdown(); // eslint-disable-line no-use-before-define
44+
closeDropdown(); // eslint-disable-line ts/no-use-before-define
4545
}).on('mouseenter', function () {
4646
$(this).css('background', 'var(--highlight-color, #e8f0fe)');
4747
}).on('mouseleave', function () {

0 commit comments

Comments
 (0)