mirror of
https://github.com/google/nomulus
synced 2026-08-02 13:26:09 +00:00
Change syncRemoteTask scheduled task to be a POST (#3185)
Turns out before we were using GET for everything. The action is, and should remain, a POST on the back end so let's call that.
This commit is contained in:
+1
@@ -326,6 +326,7 @@
|
||||
<task>
|
||||
<url><![CDATA[/_dr/task/syncRemoteCache]]></url>
|
||||
<name>syncRemoteCache</name>
|
||||
<method>POST</method>
|
||||
<description>
|
||||
Syncs remote (Valkey/Redis) EPP resource caches with changes made recently.
|
||||
</description>
|
||||
|
||||
@@ -71,6 +71,7 @@ type Task struct {
|
||||
Timeout string `xml:"timeout"`
|
||||
Schedule string `xml:"schedule"`
|
||||
Name string `xml:"name"`
|
||||
Method string `xml:"method"`
|
||||
}
|
||||
|
||||
type QueuesSyncManager struct {
|
||||
@@ -191,6 +192,11 @@ func (manager TasksSyncManager) getArgs(task Task, operationType string) []strin
|
||||
var uri string
|
||||
uri = fmt.Sprintf("https://%s.%s%s", service, baseDomain, strings.TrimSpace(task.URL))
|
||||
|
||||
method := "get"
|
||||
if task.Method != "" {
|
||||
method = strings.ToLower(task.Method)
|
||||
}
|
||||
|
||||
args := []string{
|
||||
"--project", projectName,
|
||||
"scheduler", "jobs", operationType,
|
||||
@@ -199,7 +205,7 @@ func (manager TasksSyncManager) getArgs(task Task, operationType string) []strin
|
||||
"--schedule", task.Schedule,
|
||||
"--uri", uri,
|
||||
"--description", description,
|
||||
"--http-method", "get",
|
||||
"--http-method", method,
|
||||
"--oidc-service-account-email", getCloudSchedulerServiceAccountEmail(),
|
||||
"--oidc-token-audience", clientId,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user