fix: recover run runtime state and logs
This commit is contained in:
@@ -69,6 +69,12 @@ func ValidateRunLifecycleReport(report domain.RunLifecycleReport) error {
|
||||
violations = appendProgressViolations(violations, report.Progress)
|
||||
violations = appendMessageLength(violations, "message", report.Message)
|
||||
violations = appendMessageLength(violations, "errorCode", report.ErrorCode)
|
||||
if report.ManagedProcessID != "" && report.ObservationSeq == 0 {
|
||||
violations = append(violations, "observationSeq is required with managedProcessId")
|
||||
}
|
||||
if report.ObservationSeq > 0 && report.ManagedProcessID == "" {
|
||||
violations = append(violations, "managedProcessId is required with observationSeq")
|
||||
}
|
||||
if len([]byte(report.ExecutionResult.Content)) > maxJobChannelMessageLength*256 {
|
||||
violations = append(violations, "executionResult.content is too large")
|
||||
}
|
||||
|
||||
@@ -87,6 +87,15 @@ func ValidateLogStreamCursorQuery(query domain.LogStreamCursorQuery) error {
|
||||
return finish(violations)
|
||||
}
|
||||
|
||||
func ValidateRunLogStreamProgress(request domain.RunLogStreamProgress) error {
|
||||
var violations []string
|
||||
violations = appendRequired(violations, "runEndpointId", request.RunEndpointID)
|
||||
violations = appendRequired(violations, "sessionToken", request.SessionToken)
|
||||
violations = appendRequired(violations, "serverInstanceId", request.ServerInstanceID)
|
||||
violations = appendRequired(violations, "logStreamId", request.LogStreamID)
|
||||
return finish(violations)
|
||||
}
|
||||
|
||||
func LogEntriesChecksum(entries []domain.LogEntry) (string, error) {
|
||||
stable := make([]logEntryChecksumBody, len(entries))
|
||||
for i, entry := range entries {
|
||||
|
||||
Reference in New Issue
Block a user