Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/workers/runcode/runcodefile_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ func coderunworker(ctx context.Context, msg modelmain.CodeRun) {
}

uid := uuid.NewString()
line := wrkerconfig.Secrets.Replace(err.Error())
// err is the error of the command, stderr is the error from the Python script
line := wrkerconfig.Secrets.Replace(err.Error() + ":\n" + stderr.String())

logmsg := modelmain.LogsCodeRun{
CreatedAt: time.Now().UTC(),
Expand Down Expand Up @@ -378,7 +379,9 @@ func coderunworker(ctx context.Context, msg modelmain.CodeRun) {
if err != nil {

uid := uuid.NewString()
line := wrkerconfig.Secrets.Replace(err.Error())

// err is the error of the command, stderr is the error from the Python script
line := wrkerconfig.Secrets.Replace(err.Error() + ": \n" + stderr.String())

logmsg := modelmain.LogsCodeRun{
CreatedAt: time.Now().UTC(),
Expand Down
14 changes: 9 additions & 5 deletions app/workers/runtask/runtask.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ func worker(ctx context.Context, msg modelmain.WorkerTaskSend) {
err2 = database.DBConn.Select("run_id", "status").Where("run_id = ?", msg.RunID).First(&pipelineCheck).Error
if err2 != nil {
log.Println(err2.Error())
WSLogError("Pipeline marked as failed - runid:"+msg.RunID+" - node:"+msg.NodeID, msg, TaskUpdate)
SilentWSLogError("Pipeline marked as failed - runid:"+msg.RunID+" - node:"+msg.NodeID, msg)
return
}

if pipelineCheck.Status != "Running" {

log.Println("Skipping pipeline not in running state", msg.RunID, msg.NodeID)

WSLogError("Skipping pipeline not in running state - runid:"+msg.RunID+" - node:"+msg.NodeID, msg, TaskUpdate)
SilentWSLogError("Skipping pipeline not in running state - runid:"+msg.RunID+" - node:"+msg.NodeID, msg)

TaskFinal := modelmain.WorkerTasks{
TaskID: msg.TaskID,
Expand Down Expand Up @@ -254,7 +254,7 @@ func worker(ctx context.Context, msg modelmain.WorkerTaskSend) {
log.Println("Directory not found:", directoryRun)
}

WSLogError("Directory not found:"+directoryRun, msg, TaskUpdate)
SilentWSLogError("Directory not found:"+directoryRun, msg)

// Self-healing the directory
log.Println("Directory not found, removing cache for pipeline:", msg.PipelineID, msg.EnvironmentID)
Expand Down Expand Up @@ -415,7 +415,9 @@ func worker(ctx context.Context, msg modelmain.WorkerTaskSend) {
}

uid := uuid.NewString()
line := wrkerconfig.Secrets.Replace(err.Error())

// err is the error of the command, stderr is the error from the Python script
line := wrkerconfig.Secrets.Replace(err.Error() + ":\n" + stderr.String())

logmsg := modelmain.LogsWorkers{
CreatedAt: time.Now().UTC(),
Expand Down Expand Up @@ -472,7 +474,9 @@ func worker(ctx context.Context, msg modelmain.WorkerTaskSend) {
if err != nil {

uid := uuid.NewString()
line := wrkerconfig.Secrets.Replace(err.Error())

// err is the error of the command, stderr is the error from the Python script
line := wrkerconfig.Secrets.Replace(err.Error() + ":\n" + stderr.String())

logmsg := modelmain.LogsWorkers{
CreatedAt: time.Now().UTC(),
Expand Down