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

add preheat implements #1456

Merged
merged 6 commits into from
Aug 25, 2020
Merged

add preheat implements #1456

merged 6 commits into from
Aug 25, 2020

Conversation

ansinlee
Copy link

No description provided.

@starnop
Copy link
Contributor

starnop commented Aug 18, 2020

@jim3ma PTAL. Thanks.

@@ -60,8 +61,8 @@ func (s *Server) getPreheatTask(ctx context.Context, rw http.ResponseWriter, req
}
resp := types.PreheatInfo{
ID: task.ID,
FinishTime: strfmt.NewDateTime(),
StartTime: strfmt.NewDateTime(),
FinishTime: strfmt.DateTime(time.Unix(task.FinishTime/1000, task.FinishTime%1000*int64(time.Millisecond)).UTC()),
Copy link
Contributor

@starnop starnop Aug 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change type of FinishTime form int64 to time.Time? WDYT? So do with StartTime.

)

const(
EXPIRED_TIME = 7 * 24 * 3600 * 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

func(r *PreheatTaskRepository) load() {
r.loaded.Do(func(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


func init() {
RegisterPreheater("file", &FilePreheat{BasePreheater:new(BasePreheater)})
logrus.StandardLogger().SetLevel(logrus.DebugLevel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test code?

}

func (svc *PreheatService) createCommand(url string, header map[string]string, filter, identifier, tmpTarget string) *exec.Cmd {
netRate := 50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't use magic numbers? It is easy to make others confused.

Signed-off-by: 玉海 <[email protected]>
@garfield009
Copy link
Contributor

agree

@garfield009 garfield009 merged commit 5c732d5 into dragonflyoss:master Aug 25, 2020
wuchaojing pushed a commit to wuchaojing/Dragonfly that referenced this pull request Aug 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants