X-Git-Url: https://git.jacobcasper.com/?p=brackets.git;a=blobdiff_plain;f=scrape%2Fgraph%2Fgraph.go;h=fe150b7263751d41430960c74ae40667878fb271;hp=7a319241689e8bd196d12b0b507cf95dbe6b30bf;hb=08c4c2a95b36d696660482621f504693b4070126;hpb=d7efcbb707115b400fa46fdda820bc597a7e01a5 diff --git a/scrape/graph/graph.go b/scrape/graph/graph.go index 7a31924..fe150b7 100644 --- a/scrape/graph/graph.go +++ b/scrape/graph/graph.go @@ -43,6 +43,22 @@ WHERE ID NOT IN ( success := true postArtists: for _, artist := range artists { + row := env.Db.Db.QueryRow(` +SELECT EXISTS ( + SELECT 1 + FROM ARTIST + WHERE ID = ? +) +`, + artist.ID) + var exists bool + if err := row.Scan(&exists); err != nil { + // We don't care, this was a short circuit check + } + if exists { + continue postArtists + } + resp, err := http.PostForm("http://localhost:8080/artist/add", url.Values{"id": {string(artist.ID)}}) if err != nil { log.Print(err)