Skip to content
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

Place kv_namespaces correctly in wrangler template. #2

Merged
merged 1 commit into from
Feb 12, 2023
Merged
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
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,15 @@ async function doExecute(env: Env) {
const results = await fetchNordigenTransactions(token, env.NORDIGEN_ACCOUNT_ID, dateFrom, dateTo);

console.log("booked", results.transactions.booked);
console.log("pending", results.transactions.pending);

// store transactions in DB
await storeBankTransactions(env.DB, results.transactions.booked);

// read transaction matchers from KV
const transactionMatchers = await fetchTransactionMatchers(env.KV);

console.log("matchers", transactionMatchers);

// create map of matching transactions
const matched = new Map<string, BankTransaction>();

Expand Down
8 changes: 4 additions & 4 deletions wrangler.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name = "bankman"
main = "src/index.ts"
compatibility_date = "2022-12-20"

kv_namespaces = [
{ binding = "KV", id = "$KV_ID" }
]

[triggers]
crons = [ "0 * * * *" ]

[[ d1_databases ]]
binding = "DB"
database_name = "bankmandb"
database_id = "$DATABASE_ID"

kv_namespaces = [
{ binding = "KV", id = "$KV_ID" }
]