mirror of
https://github.com/bewcloud/bewcloud.git
synced 2026-03-11 08:54:49 +00:00
Update dependencies, add more logging to crons
This commit is contained in:
parent
bcf54f148e
commit
7fd29ba7bf
9 changed files with 20 additions and 16 deletions
2
.dvmrc
2
.dvmrc
|
|
@ -1 +1 @@
|
|||
1.41.3
|
||||
1.42.4
|
||||
|
|
|
|||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -9,7 +9,7 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
- uses: denoland/setup-deno@v1
|
||||
with:
|
||||
deno-version: v1.41.3
|
||||
deno-version: v1.42.4
|
||||
- run: |
|
||||
make test
|
||||
make build
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM denoland/deno:ubuntu-1.41.3
|
||||
FROM denoland/deno:ubuntu-1.42.4
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ export async function cleanupSessions() {
|
|||
const yesterday = new Date(new Date().setUTCDate(new Date().getUTCDate() - 1));
|
||||
|
||||
try {
|
||||
console.info('Will cleanup user sessions');
|
||||
|
||||
const result = await db.query<{ count: number }>(
|
||||
sql`WITH "deleted" AS (
|
||||
DELETE FROM "bewcloud_user_sessions" WHERE "expires_at" <= $1 RETURNING *
|
||||
|
|
@ -16,8 +18,8 @@ export async function cleanupSessions() {
|
|||
],
|
||||
);
|
||||
|
||||
console.log('Deleted', result[0].count, 'user sessions');
|
||||
console.info('Deleted', result[0].count, 'user sessions');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Cron } from 'https://deno.land/x/croner@7.0.1/dist/croner.js';
|
||||
import { Cron } from 'https://deno.land/x/croner@8.0.1/dist/croner.js';
|
||||
|
||||
import { cleanupSessions } from './cleanup.ts';
|
||||
import { fetchNewArticles } from './news.ts';
|
||||
|
|
|
|||
|
|
@ -16,10 +16,12 @@ export async function fetchNewArticles(forceFetch = false) {
|
|||
],
|
||||
);
|
||||
|
||||
console.info('Will crawl', feedsToCrawl.length, 'news feeds');
|
||||
|
||||
await concurrentPromises(feedsToCrawl.map((newsFeed) => () => crawlNewsFeed(newsFeed)), 3);
|
||||
|
||||
console.log('Crawled', feedsToCrawl.length, 'news feeds');
|
||||
console.info('Crawled', feedsToCrawl.length, 'news feeds');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@
|
|||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
|
||||
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1",
|
||||
"tailwindcss": "npm:tailwindcss@3.4.1",
|
||||
"tailwindcss/": "npm:/tailwindcss@3.4.1/",
|
||||
"tailwindcss/plugin": "npm:/tailwindcss@3.4.1/plugin.js",
|
||||
"std/": "https://deno.land/std@0.220.1/",
|
||||
"$std/": "https://deno.land/std@0.220.1/"
|
||||
"tailwindcss": "npm:tailwindcss@3.4.3",
|
||||
"tailwindcss/": "npm:/tailwindcss@3.4.3/",
|
||||
"tailwindcss/plugin": "npm:/tailwindcss@3.4.3/plugin.js",
|
||||
"std/": "https://deno.land/std@0.223.0/",
|
||||
"$std/": "https://deno.land/std@0.223.0/"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export const handler: Handlers<Data, FreshContextState> = {
|
|||
},
|
||||
};
|
||||
|
||||
export default function Dashboard({ data }: PageProps<Data, FreshContextState>) {
|
||||
export default function DashboardPage({ data }: PageProps<Data, FreshContextState>) {
|
||||
const initialNotes = data?.userDashboard?.data?.notes || 'Jot down some notes here.';
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Handlers, PageProps } from 'fresh/server.ts';
|
||||
|
||||
import { Dashboard, FreshContextState } from '/lib/types.ts';
|
||||
import { FreshContextState } from '/lib/types.ts';
|
||||
import { PASSWORD_SALT } from '/lib/auth.ts';
|
||||
import {
|
||||
createVerificationCode,
|
||||
|
|
@ -180,7 +180,7 @@ export const handler: Handlers<Data, FreshContextState> = {
|
|||
},
|
||||
};
|
||||
|
||||
export default function Dashboard({ data }: PageProps<Data, FreshContextState>) {
|
||||
export default function SettingsPage({ data }: PageProps<Data, FreshContextState>) {
|
||||
return (
|
||||
<main>
|
||||
<Settings formData={data?.formData} error={data?.error} notice={data?.notice} />
|
||||
|
|
|
|||
Loading…
Reference in a new issue