Skip to content

Commit

Permalink
fix(aws): aws caching fails if aws client is not initialised (#178)
Browse files Browse the repository at this point in the history
* fix(aws): aws caching fails if aws client is not inited

* fix(revert): remove redundant check
  • Loading branch information
Todmy authored Sep 7, 2023
1 parent 80d84a7 commit 2bef6d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ async function streamToString(stream: Readable): Promise<string> {
}

export async function set(key, value) {
if (!client) return;
try {
return await client.putObject({
Bucket: process.env.AWS_BUCKET_NAME,
Expand All @@ -31,6 +32,7 @@ export async function set(key, value) {
}

export async function get(key) {
if (!client) return false;
try {
const { Body } = await client.getObject({
Bucket: process.env.AWS_BUCKET_NAME,
Expand Down

0 comments on commit 2bef6d3

Please sign in to comment.