Skip to content

update: implement env vars for cache config #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.wrangler
.DS_Store
13 changes: 7 additions & 6 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
export const Config = {
// Hasura secret to verify the sender.
headers: { "hasura-m-auth": "zZkhKqFjqXR4g5MZCsJUZCnhCcoPyZ" },
headers: { "hasura-m-auth": process.env.HASURA_M_AUTH },

// A list of queries we'd like to cache.
//
// These queries can also be written over multiple lines with whatever
// indentation you'd prefer, as the hashing key mechanism works in terms of
// the parsed query, which doesn't preserve whitespace.
queries_to_cache: [
{ query: "query test { artist { name } }"
{
query: "query test { artist { name } }",

// The time for which a value will survive in the cache. After this, the
// cache will be invalidated, and the next occurrence of the query will
// repopulate the cache.
, time_to_live: 6
}
time_to_live: 6,
},
],

// The URL for a Redis instance.
redis_url: "redis://redis:6379",
redis_url: process.env.GLOBAL_REDIS_INSTANCE_URL,

// The URL for an opentelemetry collector.
otel_endpoint: "http://jaeger:4318/v1/traces",
otel_endpoint: process.env.GLOBAL_OTEL_EXPORTER_OTLP_ENDPOINT,

// Any other OpenTelemetry headers to send to the collector.
// otel_headers: { Authorization: 'pat <my-personal-access-token>' }
Expand Down