Adding the upload interval as parameter to tap function

This commit is contained in:
Igor Gov
2021-07-13 17:26:22 +03:00
parent 78456d7987
commit 79816ae337
5 changed files with 8 additions and 7 deletions

View File

@@ -159,7 +159,7 @@ func UploadEntries(c *fiber.Ctx) error {
return c.Status(fiber.StatusServiceUnavailable).SendString("Can't get token")
}
rlog.Infof("Upload entries - uploading. token: %s model: %s\n", token.Token, token.Model)
go up9.UploadEntriesImpl(token.Token, token.Model, uploadRequestBody.Dest)
go up9.UploadEntriesImpl(token.Token, token.Model, uploadRequestBody.Dest, uploadRequestBody.sleepIntervalSec)
return c.Status(fiber.StatusOK).SendString("OK")
}

View File

@@ -100,8 +100,6 @@ func (fedex *FullEntryDetailsExtra) UnmarshalData(entry *MizuEntry) error {
return nil
}
type EntryData struct {
Entry string `json:"entry,omitempty"`
ResolvedDestination string `json:"resolvedDestination,omitempty" gorm:"column:resolvedDestination"`
@@ -114,7 +112,8 @@ type EntriesFilter struct {
}
type UploadEntriesRequestBody struct {
Dest string `query:"dest"`
Dest string `query:"dest"`
sleepIntervalSec int `query:"interval"`
}
type HarFetchRequestBody struct {

View File

@@ -112,13 +112,13 @@ func GetAnalyzeInfo() *shared.AnalyzeStatus {
}
}
func UploadEntriesImpl(token string, model string, envPrefix string) {
func UploadEntriesImpl(token string, model string, envPrefix string, sleepIntervalSec int) {
analyzeInformation.IsAnalyzing = true
analyzeInformation.AnalyzedModel = model
analyzeInformation.AnalyzeToken = token
analyzeInformation.AnalyzeDestination = envPrefix
sleepTime := time.Second * 10
sleepTime := time.Second * time.Duration(sleepIntervalSec)
var timestampFrom int64 = 0