refactor: fix types
This commit is contained in:
parent
8a0627f37c
commit
b72e87ffd2
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
import { createClient } from 'redis'
|
import { createClient, type RedisJSON } from 'redis'
|
||||||
import { type ArticleData, extract } from '@extractus/article-extractor'
|
import { type ArticleData, extract } from '@extractus/article-extractor'
|
||||||
|
|
||||||
import SimpleAddressBar from '../components/SimpleAddressBar.astro'
|
import SimpleAddressBar from '../components/SimpleAddressBar.astro'
|
||||||
import Post from '../components/Post.astro'
|
import Post from '../components/Post.astro'
|
||||||
import App from '../layouts/App.astro'
|
import App from '../layouts/App.astro'
|
||||||
|
@ -31,7 +32,7 @@ if (url && url !== '/' && url !== '') {
|
||||||
console.log('>>> Using fetched content', article?.url)
|
console.log('>>> Using fetched content', article?.url)
|
||||||
if (article !== null) {
|
if (article !== null) {
|
||||||
// cache via redis
|
// cache via redis
|
||||||
await client.json.set('cozy:url:' + url, '$', article)
|
await client.json.set('cozy:url:' + url, '$', article as RedisJSON)
|
||||||
console.log('>>> Added to cache', article.url)
|
console.log('>>> Added to cache', article.url)
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in a new issue