mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-01-30 05:54:21 +00:00
Adding the upload interval as parameter to tap function
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user