Skip to content

Commit

Permalink
Added date to the key/file path
Browse files Browse the repository at this point in the history
  • Loading branch information
caparker committed Apr 24, 2024
1 parent 1bf1a6e commit ad3e336
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fetcher/lib/providers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs');
const path = require('path');
const dayjs = require('dayjs');
const { SNSClient, PublishCommand } = require('@aws-sdk/client-sns');

const {
Expand Down Expand Up @@ -167,9 +168,10 @@ class Providers {
return console.warn('Nothing found, not uploading to S3.');
}
const Bucket = process.env.BUCKET;
const today = dayjs().format('YYYY-MM-DD');
const filename = id || `${Math.floor(Date.now() / 1000)}-${Math.random().toString(36).substring(8)}`;
//const Key = `${process.env.STACK}/measures/${provider}/${filename}.json.gz`;

Check failure on line 173 in fetcher/lib/providers.js

View workflow job for this annotation

GitHub Actions / build

Expected space or tab after '//' in comment
const Key = `local-testing/measures/${provider}/${filename}.json.gz`;
const Key = `local-testing/measures/${provider}/${today}/${filename}.json.gz`;
const compressedString = await gzip(JSON.stringify(data));


Expand Down

0 comments on commit ad3e336

Please sign in to comment.