Skip to content

Commit

Permalink
Add keepAlive option to FTPActions
Browse files Browse the repository at this point in the history
  • Loading branch information
TAEMBO committed Aug 26, 2024
1 parent d1110c1 commit 7e911ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/structures/ftpActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { FSServer } from "#typings";
import { stringifyStream } from "#util";

export class FTPActions extends FTPClient {
public constructor(private config: FSServer["ftp"]) {
public constructor(private config: FSServer["ftp"], private keepAlive = false) {
super();
}

Expand All @@ -21,7 +21,7 @@ export class FTPActions extends FTPClient {
async (err, stream) => err ? rej(err) : res(await stringifyStream(stream))
));

super.end();
if (!this.keepAlive) super.end();

return data;
}
Expand All @@ -35,7 +35,7 @@ export class FTPActions extends FTPClient {
(err) => err ? rej(err) : res()
));

super.end();
if (!this.keepAlive) super.end();
}

public async delete(path: string) {
Expand All @@ -46,6 +46,6 @@ export class FTPActions extends FTPClient {
(err) => err ? rej(err) : res()
));

super.end();
if (!this.keepAlive) super.end();
}
}

0 comments on commit 7e911ea

Please sign in to comment.