Files CRUD.
Remove Contacts and Calendar + CardDav and CalDav.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import Database, { sql } from '/lib/interfaces/database.ts';
|
||||
import Locker from '/lib/interfaces/locker.ts';
|
||||
import { NewsFeed } from '/lib/types.ts';
|
||||
import { concurrentPromises } from '/lib/utils/misc.ts';
|
||||
import { crawlNewsFeed } from '/lib/data/news.ts';
|
||||
@@ -9,10 +8,6 @@ const db = new Database();
|
||||
export async function fetchNewArticles(forceFetch = false) {
|
||||
const fourHoursAgo = forceFetch ? new Date() : new Date(new Date().setUTCHours(new Date().getUTCHours() - 4));
|
||||
|
||||
const lock = new Locker(`feeds`);
|
||||
|
||||
await lock.acquire();
|
||||
|
||||
try {
|
||||
const feedsToCrawl = await db.query<NewsFeed>(
|
||||
sql`SELECT * FROM "bewcloud_news_feeds" WHERE "last_crawled_at" IS NULL OR "last_crawled_at" <= $1`,
|
||||
@@ -27,6 +22,4 @@ export async function fetchNewArticles(forceFetch = false) {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
lock.release();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user