update cicd
This commit is contained in:
@@ -65,31 +65,61 @@ func buildAdminJob(job *model.Job) *appv1.AdminJob {
|
||||
if job == nil {
|
||||
return nil
|
||||
}
|
||||
agentID := strconv.FormatInt(*job.AgentID, 10)
|
||||
var agentID *string
|
||||
if job.AgentID != nil {
|
||||
value := strconv.FormatInt(*job.AgentID, 10)
|
||||
agentID = &value
|
||||
}
|
||||
return &appv1.AdminJob{
|
||||
Id: job.ID,
|
||||
Status: string(*job.Status),
|
||||
Priority: int32(*job.Priority),
|
||||
UserId: *job.UserID,
|
||||
Status: stringValue(job.Status),
|
||||
Priority: int32(int64Value(job.Priority)),
|
||||
UserId: stringValue(job.UserID),
|
||||
Name: job.ID,
|
||||
TimeLimit: *job.TimeLimit,
|
||||
InputUrl: *job.InputURL,
|
||||
OutputUrl: *job.OutputURL,
|
||||
TotalDuration: *job.TotalDuration,
|
||||
CurrentTime: *job.CurrentTime,
|
||||
Progress: *job.Progress,
|
||||
AgentId: &agentID,
|
||||
Logs: *job.Logs,
|
||||
Config: *job.Config,
|
||||
Cancelled: *job.Cancelled,
|
||||
RetryCount: int32(*job.RetryCount),
|
||||
MaxRetries: int32(*job.MaxRetries),
|
||||
CreatedAt: timestamppb.New(*job.CreatedAt),
|
||||
UpdatedAt: timestamppb.New(*job.UpdatedAt),
|
||||
VideoId: stringPointerOrNil(*job.VideoID),
|
||||
TimeLimit: int64Value(job.TimeLimit),
|
||||
InputUrl: stringValue(job.InputURL),
|
||||
OutputUrl: stringValue(job.OutputURL),
|
||||
TotalDuration: int64Value(job.TotalDuration),
|
||||
CurrentTime: int64Value(job.CurrentTime),
|
||||
Progress: float64Value(job.Progress),
|
||||
AgentId: agentID,
|
||||
Logs: stringValue(job.Logs),
|
||||
Config: stringValue(job.Config),
|
||||
Cancelled: boolValue(job.Cancelled),
|
||||
RetryCount: int32(int64Value(job.RetryCount)),
|
||||
MaxRetries: int32(int64Value(job.MaxRetries)),
|
||||
CreatedAt: timeToProto(job.CreatedAt),
|
||||
UpdatedAt: timeToProto(job.UpdatedAt),
|
||||
VideoId: job.VideoID,
|
||||
}
|
||||
}
|
||||
|
||||
func buildAdminDlqEntry(entry *dto.DLQEntry) *appv1.AdminDlqEntry {
|
||||
if entry == nil {
|
||||
return nil
|
||||
}
|
||||
return &appv1.AdminDlqEntry{
|
||||
Job: buildAdminJob(entry.Job),
|
||||
FailureTime: timestamppb.New(time.Unix(entry.FailureTime, 0).UTC()),
|
||||
Reason: entry.Reason,
|
||||
RetryCount: int32(entry.RetryCount),
|
||||
}
|
||||
}
|
||||
|
||||
func int64Value(value *int64) int64 {
|
||||
if value == nil {
|
||||
return 0
|
||||
}
|
||||
return *value
|
||||
}
|
||||
|
||||
func float64Value(value *float64) float64 {
|
||||
if value == nil {
|
||||
return 0
|
||||
}
|
||||
return *value
|
||||
}
|
||||
|
||||
func buildAdminAgent(agent *dto.AgentWithStats) *appv1.AdminAgent {
|
||||
if agent == nil || agent.Agent == nil {
|
||||
return nil
|
||||
@@ -526,15 +556,20 @@ func (s *appServices) buildAdminPopupAd(ctx context.Context, item *model.PopupAd
|
||||
}
|
||||
|
||||
payload := &appv1.AdminPopupAd{
|
||||
Id: item.ID,
|
||||
UserId: item.UserID,
|
||||
Type: item.Type,
|
||||
Label: item.Label,
|
||||
Value: item.Value,
|
||||
IsActive: boolValue(item.IsActive),
|
||||
MaxTriggersPerSession: func() int32 { if item.MaxTriggersPerSession != nil { return *item.MaxTriggersPerSession }; return 0 }(),
|
||||
CreatedAt: timeToProto(item.CreatedAt),
|
||||
UpdatedAt: timeToProto(item.UpdatedAt),
|
||||
Id: item.ID,
|
||||
UserId: item.UserID,
|
||||
Type: item.Type,
|
||||
Label: item.Label,
|
||||
Value: item.Value,
|
||||
IsActive: boolValue(item.IsActive),
|
||||
MaxTriggersPerSession: func() int32 {
|
||||
if item.MaxTriggersPerSession != nil {
|
||||
return *item.MaxTriggersPerSession
|
||||
}
|
||||
return 0
|
||||
}(),
|
||||
CreatedAt: timeToProto(item.CreatedAt),
|
||||
UpdatedAt: timeToProto(item.UpdatedAt),
|
||||
}
|
||||
|
||||
ownerEmail, err := s.loadAdminUserEmail(ctx, item.UserID)
|
||||
|
||||
Reference in New Issue
Block a user