Merge branch 'Crossbell-Box:dev' into dev

This commit is contained in:
Reg Chien 2023-03-28 14:11:58 +08:00 committed by GitHub
commit ef3590e615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 33 deletions

View File

@ -25,6 +25,13 @@ spec:
prometheus.io/scrape: "true"
spec:
enableServiceLinks: false
nodeSelector:
rss3.io/usage: csb-others
tolerations:
- key: "rss3.io/usage"
operator: "Equal"
value: "csb-others"
effect: "NoSchedule"
containers:
- image: $IMAGE_TAG_RELEASE
imagePullPolicy: Always

View File

@ -8,6 +8,6 @@
33483, 19, 50877, 33420, 50094, 49213, 33276, 50351, 42993, 50216, 50132,
45763, 50143, 43754, 32168, 500, 47399, 33538, 48951, 33471, 33396, 37223,
33458, 39133, 20004, 43625, 42787, 43258, 33462, 47109, 46939, 45701, 33233,
37346, 40671, 33870, 33421, 51552, 51585, 51477, 48937, 51562, 51379, 51460,
51509, 51478, 51639, 48910
37346, 40671, 33870, 33421, 51552, 51585, 48937, 51379, 51460, 51084, 51509,
51478, 51639, 48910, 51139, 39329, 51683, 51077, 51374, 49120, 47356
]

View File

@ -202,7 +202,7 @@ export const SiteHeader: React.FC<{
className={cn(
"xlog-site-info flex space-x-6 items-center w-full",
site?.banners?.[0]?.address
? "bg-white bg-opacity-50 backdrop-blur-sm rounded-xl p-8 z-[1] border"
? "bg-white bg-opacity-50 backdrop-blur-sm rounded-xl p-4 sm:p-8 z-[1] border"
: "",
)}
>

View File

@ -25,35 +25,37 @@ export default async function handler(
if (cache) {
res.status(200).json(JSON.parse(cache))
} else {
const result = await getNFTs(query.address as string)
await Promise.all(
result.list.map(async (nft: Asset) => {
if (!nft.items?.[0].mime_type && nft.items?.[0]?.address) {
try {
const mime_type = await cacheGet({
key: `nft-mimetype/${nft.items[0].address}`,
getValueFun: async () => {
const head = await fetch(
`${nft.items![0].address!.replace(
IPFS_GATEWAY,
"https://gateway.ipfs.io/ipfs/",
)}`,
{
method: "HEAD",
},
)
return head.headers.get("content-type")
},
})
nft.items[0].mime_type = mime_type
} catch (error) {
console.warn(error)
}
}
return nft
}),
)
redis.set(redisKey, JSON.stringify(result), "EX", 60 * 60 * 24)
res.status(200).json(result)
// const result = await getNFTs(query.address as string)
// await Promise.all(
// result.list.map(async (nft: Asset) => {
// if (!nft.items?.[0].mime_type && nft.items?.[0]?.address) {
// try {
// const mime_type = await cacheGet({
// key: `nft-mimetype/${nft.items[0].address}`,
// getValueFun: async () => {
// const head = await fetch(
// `${nft.items![0].address!.replace(
// IPFS_GATEWAY,
// "https://gateway.ipfs.io/ipfs/",
// )}`,
// {
// method: "HEAD",
// },
// )
// return head.headers.get("content-type")
// },
// })
// nft.items[0].mime_type = mime_type
// } catch (error) {
// console.warn(error)
// }
// }
// return nft
// }),
// )
// redis.set(redisKey, JSON.stringify(result), "EX", 60 * 60 * 24)
res.status(200).json({
list: [],
})
}
}