This commit is contained in:
royalcat 2024-04-24 20:36:33 +03:00
parent 5591f145a9
commit d8ee8a3a24
166 changed files with 15431 additions and 889 deletions
cmd
generate-graphql-schema
tstor

View file

@ -0,0 +1,27 @@
package main
import (
"fmt"
"log"
"os"
graph "git.kmsign.ru/royalcat/tstor/src/delivery/graphql"
"github.com/vektah/gqlparser/v2/formatter"
)
func main() {
outFile := "schema.graphql"
if len(os.Args) > 1 {
outFile = os.Args[1]
}
file, err := os.OpenFile(outFile, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm)
if err != nil {
log.Panic(fmt.Errorf("Failed to open %s: %w", outFile, err))
}
defer file.Close()
fmt := formatter.NewFormatter(file)
fmt.FormatSchema(graph.NewExecutableSchema(graph.Config{}).Schema())
}

View file

@ -70,18 +70,15 @@ func run(configPath string) error {
}
// dlog.Load(&conf.Log)
if conf.OtelHttp != "" {
ctx := context.Background()
client, err := telemetry.Setup(ctx, conf.OtelHttp)
if err != nil {
return err
}
defer client.Shutdown(ctx)
ctx := context.Background()
client, err := telemetry.Setup(ctx, conf.OtelHttp)
if err != nil {
return err
}
defer client.Shutdown(ctx)
log := rlog.Component("run")
ctx := context.Background()
// TODO make optional
err = syscall.Setpriority(syscall.PRIO_PGRP, 0, 19)