f-21: code: ajout d'un system de worker
All checks were successful
Pre Release Workflow / set-release-target (push) Successful in 1s
Pre Release Workflow / build (agent, amd64, linux) (push) Successful in 2m2s
Pre Release Workflow / build (db, amd64, linux) (push) Successful in 1m32s
Pre Release Workflow / build (dhcp, amd64, linux) (push) Successful in 1m32s
Pre Release Workflow / build (metadata, amd64, linux) (push) Successful in 1m33s
Pre Release Workflow / build (metacli, amd64, linux) (push) Successful in 1m40s
Pre Release Workflow / build (subnet, amd64, linux) (push) Successful in 1m37s
Pre Release Workflow / prerelease (push) Successful in 16s
Pre Release Workflow / build (vpc, amd64, linux) (push) Successful in 1m34s
Pre Release Workflow / upload-scripts (run-dnsmasq-in-netns.sh) (push) Successful in 7s

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-14 21:24:13 +02:00
commit 53ca41e635
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
9 changed files with 87 additions and 14 deletions

View file

@ -6,7 +6,7 @@ import (
"strings"
)
func VpcByNameHandler(w http.ResponseWriter, r *http.Request) {
func (s *Server) VpcByNameHandler(w http.ResponseWriter, r *http.Request) {
name := strings.TrimPrefix(r.URL.Path, "/vpcs/")
if name == "" {
http.NotFound(w, r)
@ -18,8 +18,13 @@ func VpcByNameHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(map[string]string{"name": name})
case http.MethodDelete:
s.queue.Submit(func() {
deleteVpc(name)
})
w.WriteHeader(http.StatusAccepted)
default:
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
}
}
func deleteVpc(name string) {}