Skip to content
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
24 changes: 16 additions & 8 deletions confidence-cloudflare-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,22 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
.run(req, env)
.await;

let aggregated = FLAG_LOGGER.pop_flag_log_batch();
if !(aggregated.flag_assigned.is_empty()
&& aggregated.flag_resolve_info.is_empty()
&& aggregated.client_resolve_info.is_empty())
{
let converted = serde_json::to_string(&aggregated)?;
console_log!("FLAGS_LOGS_QUEUE:{}", converted);
}
wasm_bindgen_futures::spawn_local(async move {
let aggregated = FLAG_LOGGER.pop_flag_log_batch();
if !(aggregated.flag_assigned.is_empty()
&& aggregated.flag_resolve_info.is_empty()
&& aggregated.client_resolve_info.is_empty())
{
if let Ok(converted) = serde_json::to_string(&aggregated) {
FLAGS_LOGS_QUEUE
.get()
.unwrap()
.send(converted)
.await
.unwrap();
}
}
});

response
}
Expand Down
47 changes: 0 additions & 47 deletions confidence-cloudflare-resolver/tail/src/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions confidence-cloudflare-resolver/tail/wrangler.toml

This file was deleted.

5 changes: 4 additions & 1 deletion confidence-cloudflare-resolver/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name = "confidence-cloudflare-resolver"
main = "build/worker/shim.mjs"
compatibility_date = "2025-01-28"
tail_consumers = [{service = "confidence-resolver-tail"}]

[observability]
enabled = true
Expand All @@ -11,6 +10,10 @@ queue = "flag-logs-queue"
max_batch_size = 100 # max number of messages in a batch
max_batch_timeout = 10 # seconds

[[queues.producers]]
queue = "flag-logs-queue"
binding = "flag_logs_queue"

[vars]
CONFIDENCE_CLIENT_ID = "ID"
CONFIDENCE_CLIENT_SECRET = "SECRET"
Loading