Merged in fix/common-package-fix (pull request #2355)
fix: Tiny fixes in common package * Fix self-referencing and circular imports * Fix env isServer Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import * as Sentry from "@sentry/nextjs"
|
||||
|
||||
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
|
||||
|
||||
import { env } from "../../env/server"
|
||||
import { safeTry } from "../../utils/safeTry"
|
||||
import { type CacheTime, getCacheTimeInSeconds } from "../Cache"
|
||||
import { API_KEY } from "./client"
|
||||
import { getCacheEndpoint } from "./endpoints"
|
||||
|
||||
const API_KEY = env.REDIS_API_KEY ?? ""
|
||||
export async function set<T>(key: string, value: T, ttl: CacheTime) {
|
||||
const [response, error] = await safeTry(
|
||||
fetch(getCacheEndpoint(key), {
|
||||
|
||||
Reference in New Issue
Block a user