Skip to content

Commit

Permalink
Update route.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Feb 8, 2024
1 parent 727fcdd commit f02f1b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/routes/_.cms._index/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ export async function action({ request, context }: ActionFunctionArgs) {

if (formData.get("intent") === INTENT.dump) {
try {
console.log("creating db dump");
let dump = await context.db.dump();
console.log("db dump created");
console.log("dump size:", dump.byteLength);
let date = new Date();
await context.fs.backups.put(`${date.toISOString()}.sql`, dump);
console.log("saved to R2");
return json({ intent: INTENT.dump, success: true });
} catch (error) {
console.log(error);
Expand Down

0 comments on commit f02f1b1

Please sign in to comment.