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
chore(warehouse): warehouse api to capture task run ID when calculating the pending uploads. #2435
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2435 +/- ##
==========================================
+ Coverage 36.15% 36.21% +0.05%
==========================================
Files 200 200
Lines 39644 39676 +32
==========================================
+ Hits 14335 14368 +33
+ Misses 24407 24404 -3
- Partials 902 904 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
e9a18f8
to
b019692
Compare
@@ -1361,6 +1361,11 @@ func pendingEventsHandler(w http.ResponseWriter, r *http.Request) { | |||
// TODO : respond with errors in a common way | |||
pkgLogger.LogRequest(r) | |||
|
|||
if r.Method != "POST" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using this can we move this to the server mutex?
mux := mux.NewRouter()
mux.HandleFunc("/v1/warehouse/pending-events", pendingEventsHandler).Methods("POST")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would not need this right.
warehouse/warehouse.go
Outdated
@@ -1678,7 +1691,7 @@ func startWebHandler(ctx context.Context) error { | |||
backendconfig.DefaultBackendConfig.WaitForConfig(ctx) | |||
mux.HandleFunc("/v1/process", processHandler) | |||
// triggers uploads only when there are pending events and triggerUpload is sent for a sourceId | |||
mux.HandleFunc("/v1/warehouse/pending-events", pendingEventsHandler) | |||
mux.HandleFunc("/v1/warehouse/pending-events", pendingEventsHandler).Methods("GET") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a Methods function for ServerMux. We would need to convert it to Router.
mux := mux.NewRouter()
mux.HandleFunc("/v1/warehouse/pending-events", pendingEventsHandler).Methods("POST")
@@ -1361,6 +1361,11 @@ func pendingEventsHandler(w http.ResponseWriter, r *http.Request) { | |||
// TODO : respond with errors in a common way | |||
pkgLogger.LogRequest(r) | |||
|
|||
if r.Method != "POST" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would not need this right.
99077e4
to
8aa37a4
Compare
8aa37a4
to
7afe7b1
Compare
Description
For sources to know that the task run has no transient uploads in the system, we need to capture the task run id in the endpoint and then call the pendingUploadCount with this filterBy clause.
Notion Ticket
https://www.notion.so/rudderstacks/Warehouse-Pending-Events-API-a3e22ec2834c427fa3a7b8ed02c8e63e
Security