Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1476 from ansinlee/preheat
Browse files Browse the repository at this point in the history
change http code from 409 to 208 when create preheat which is already…
  • Loading branch information
garfield009 authored Sep 11, 2020
2 parents 1cdf00c + c1dfaae commit c0fbf31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion supernode/daemon/mgr/preheat/preheat_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"github.com/pborman/uuid"
"github.com/sirupsen/logrus"
"net/http"
"os/exec"
"path/filepath"
"strings"
Expand Down Expand Up @@ -89,7 +90,7 @@ func (svc *PreheatService) Create(task *mgr.PreheatTask) (string, error) {
task.Status = types.PreheatStatusWAITING
previous, _ := svc.repository.Add(task)
if previous != nil && previous.FinishTime > 0 {
return "", dferr.New(409, "preheat task already exists, id:" + task.ID)
return "", dferr.New(http.StatusAlreadyReported, "preheat task already exists, id:" + task.ID)
}
preheater.NewWorker(task, svc).Run()
return task.ID, nil
Expand Down

0 comments on commit c0fbf31

Please sign in to comment.