Commit 46d57369 authored by nanahira's avatar nanahira

send with interval

parent 9ae09bec
......@@ -26,6 +26,6 @@ app.plugin(DatabasePlugin);
app.plugin(ExtrasInDev);
// Target plugin
app.plugin(TargetPlugin, {} as any);
app.plugin(TargetPlugin, { attackTimeout: 120000 });
app.start();
......@@ -204,7 +204,7 @@ export default class HisoutensokuJammerPlugin implements OnApply {
const currentTime = moment();
while (moment().diff(currentTime) <= this.config.attackTimeout) {
const attacker = new Attacker(address, port, 1000);
let err;
let err: string;
try {
err = await attacker.attack();
} catch (e) {
......@@ -214,8 +214,8 @@ export default class HisoutensokuJammerPlugin implements OnApply {
this.log.warn(`Attack of ${address}:${port} failed: ${err}`);
} else {
this.log.info(`Attack of ${address}:${port} succeeded.`);
await new Promise<void>((resolve) => setTimeout(resolve, 10));
}
await new Promise<void>((resolve) => setTimeout(resolve, 10));
}
this.log.info(`Attack of ${address}:${port} finished.`);
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment