Skip to content

Commit

Permalink
removes dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
bomoko committed Oct 23, 2023
1 parent cb00ff6 commit 212f73c
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions internal/handler/processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,65 +73,3 @@ func processItemsDirectly(message mq.Message, h *Messaging) string {

return facts
}

//
//func processProblemsDirectly(message mq.Message, h *Messaging) string {
// var directProblems DirectProblems
// json.Unmarshal(message.Body(), &directProblems)
// err := json.Unmarshal(message.Body(), &directProblems)
// if err != nil {
// log.Println("Error unmarshaling JSON:", err)
// return "exciting, unable to process direct problems"
// }
//
// // since its useful to allow int and string json definitions, we need to convert strings here to ints.
// environmentId, err := strconv.Atoi(directProblems.EnvironmentId.String())
// if err != nil {
// log.Println("Error converting EnvironmentId to int:", err)
// return "exciting, unable to process direct facts"
// }
//
// if h.EnableDebug {
// log.Print("[DEBUG] problems", directProblems)
// }
//
// apiClient := graphql.NewClient(h.LagoonAPI.Endpoint, &http.Client{Transport: &authedTransport{wrapped: http.DefaultTransport, h: h}})
//
// factSources := map[string]string{}
//
// processedFacts := make([]lagoonclient.AddProblem, len(directProblems.Facts))
// for i, fact := range directProblems.Facts {
//
// vartypeString := FactTypeText
// if fact.Type == FactTypeText || fact.Type == FactTypeSemver || fact.Type == FactTypeUrl {
// vartypeString = fact.Type
// }
//
// processedFacts[i] = lagoonclient.AddFactInput{
// Environment: environmentId,
// Name: fact.Name,
// Value: fact.Value,
// Source: fact.Source,
// Description: fact.Description,
// KeyFact: false,
// Type: lagoonclient.FactType(vartypeString),
// Category: fact.Category,
// }
// factSources[fact.Source] = fact.Source
// }
//
// for _, s := range factSources {
// _, err = lagoonclient.DeleteFactsFromSource(context.TODO(), apiClient, environmentId, s)
// if err != nil {
// log.Println(err)
// }
// log.Printf("Deleted facts on '%v:%v' for source %v", directProblems.ProjectName, directProblems.EnvironmentName, s)
// }
//
// facts, err := lagoonclient.AddFacts(context.TODO(), apiClient, processedFacts)
// if err != nil {
// log.Println(err)
// }
//
// return facts
//}

0 comments on commit 212f73c

Please sign in to comment.