Skip to content

Commit

Permalink
debug api route
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Jul 31, 2024
1 parent 2e6ffcb commit 8a6a712
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/api/stores/[geoid]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export type ReqParams = {

type units = "county" | "state" | "tract" | "national"

export const revalidate = 0

const cache: Record<units, any> = {
county: {},
state: {},
Expand Down Expand Up @@ -48,9 +46,10 @@ const getStores = async (geoid: string) => {
const state = geoid.slice(0, 2) as keyof typeof cache
const filename = queryType === "tract" ? county : state

if (true || cache[queryType][filename] === undefined) {
if (true){ //cache[queryType][filename] === undefined) {
const url = `${process.env.DATA_ENDPOINT}stores/${queryType}/${filename}.msgpack.gz`
const data = await readRemoteMsgPackFile<Record<string, Record<string, StoreEntry>>>(url, true)
console.log(data)
if (Array.isArray(data)) {
if (cache[queryType][filename] === undefined) {
cache[queryType][filename] = {}
Expand Down

0 comments on commit 8a6a712

Please sign in to comment.