SHARE
TWEET

Untitled

a guest Feb 15th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async execute(event: ImportFilesEvent): Promise<void> {
  2.     const ftpConfig = await this.readFtpConfiguration();
  3.     this.ftp.configure(ftpConfig);
  4.     await this.ftp.connect();
  5.     const files = await this.ftp.list(event.ftp_path);
  6.     for (const ftpFile of files) {
  7.         const fileStream = await this.ftp.get(`${event.ftp_path}/${ftpFile.name}`);
  8.         await this.s3.put(fileStream, ftpFile.name, event.s3_bucket);
  9.         await this.ftp.delete(`${event.ftp_path}/${ftpFile.name}`);
  10.     }
  11.     this.ftp.disconnect();
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top