Skip to content

Commit

Permalink
fix: Place kv_namespaces correctly in wrangler template. (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdcalado authored Feb 12, 2023
1 parent 700ad94 commit b73b9cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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" }
]

0 comments on commit b73b9cf

Please sign in to comment.