update configs
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
export const TZ = 'America/Sao_Paulo'
|
||||
export const CACHE_NAME = 'saladeaula.digital'
|
||||
export const CACHE_TTL_SECONDS = 60 * 10
|
||||
export const INTERNAL_EMAIL_DOMAIN = 'users.noreply.saladeaula.digital'
|
||||
export const RYBBIT_SITE_ID = '83748b35413d'
|
||||
|
||||
@@ -3,6 +3,7 @@ import { createContext, redirect, type LoaderFunctionArgs } from 'react-router'
|
||||
import { userContext } from '@repo/auth/context'
|
||||
import { request as req } from '@repo/util/request'
|
||||
|
||||
import { CACHE_NAME, CACHE_TTL_SECONDS } from '@/conf'
|
||||
import type { Address } from '@/routes/_.$orgid.enrollments.buy/review'
|
||||
|
||||
export type Subscription = {
|
||||
@@ -52,7 +53,7 @@ export const workspaceMiddleware = async (
|
||||
return next()
|
||||
}
|
||||
|
||||
console.log('Cold start')
|
||||
console.log('Cache miss')
|
||||
|
||||
const r = await req({
|
||||
url: `/users/${user.sub}/orgs?limit=25`,
|
||||
@@ -122,7 +123,7 @@ function buildWorkspaceCacheKey(
|
||||
async function getWorkspaceFromCache(
|
||||
key: Request
|
||||
): Promise<WorkspaceContextProps | null> {
|
||||
const cache: Cache = await caches.open('saladeaula.digital')
|
||||
const cache: Cache = await caches.open(CACHE_NAME)
|
||||
const cached: Response | undefined = await cache.match(key)
|
||||
|
||||
if (!cached) {
|
||||
@@ -136,12 +137,12 @@ async function saveToCache(
|
||||
key: Request,
|
||||
workspace: WorkspaceContextProps
|
||||
): Promise<void> {
|
||||
const cache: Cache = await caches.open('saladeaula.digital')
|
||||
const cache: Cache = await caches.open(CACHE_NAME)
|
||||
|
||||
const response: Response = new Response(JSON.stringify(workspace), {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Cache-Control': `public, max-age=${60 * 10}`
|
||||
'Cache-Control': `public, max-age=${CACHE_TTL_SECONDS}`
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ BUCKET_NAME: str = os.getenv('BUCKET_NAME') # type: ignore
|
||||
|
||||
EMAIL_SENDER = ('EDUSEG®', 'noreply@eduseg.com.br')
|
||||
|
||||
HTTP_CONNECT_TIMEOUT = int(os.environ.get('HTTP_CONNECT_TIMEOUT', 1))
|
||||
HTTP_READ_TIMEOUT = int(os.environ.get('HTTP_READ_TIMEOUT', 3))
|
||||
HTTP_CONNECT_TIMEOUT = int(os.environ.get('HTTP_CONNECT_TIMEOUT', 2))
|
||||
HTTP_READ_TIMEOUT = int(os.environ.get('HTTP_READ_TIMEOUT', 6))
|
||||
|
||||
PAPERFORGE_API = 'https://paperforge.saladeaula.digital'
|
||||
CERT_REPORTING_URI = 's3://saladeaula.digital/certs/reporting.html'
|
||||
|
||||
Reference in New Issue
Block a user