Skip to content

Commit

Permalink
chore: Renamed file for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
matvp91 committed Oct 12, 2024
1 parent 61ca472 commit f20ea2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/artisan/src/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ export async function uploadFile(key: string, path: string) {
await upload.done();
}

export async function uploadJsonFile(key: string, content: string) {
export async function uploadJson(key: string, data: object) {
const upload = new Upload({
client,
params: {
Bucket: env.S3_BUCKET,
Key: key,
Body: content,
Body: JSON.stringify(data, null, 2),
ContentType: "application/json",
},
});
Expand Down
7 changes: 2 additions & 5 deletions packages/artisan/src/workers/transcode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { addPackageJob } from "@mixwave/artisan-producer";
import { getFakeJob } from "../helpers";
import { uploadJsonFile } from "../s3";
import { uploadJson } from "../s3";
import type {
Stream,
FfmpegResult,
Expand Down Expand Up @@ -33,10 +33,7 @@ export default async function (job: Job<TranscodeData, TranscodeResult>) {

await job.log(`Writing meta.json (${JSON.stringify(meta)})`);

await uploadJsonFile(
`transcode/${params.assetId}/meta.json`,
JSON.stringify(meta, null, 2),
);
await uploadJson(`transcode/${params.assetId}/meta.json`, meta);

if (params.packageAfter) {
await job.log("Will queue package job");
Expand Down

0 comments on commit f20ea2b

Please sign in to comment.