update
This commit is contained in:
parent
5591f145a9
commit
d8ee8a3a24
166 changed files with 15431 additions and 889 deletions
27
cmd/generate-graphql-schema/main.go
Normal file
27
cmd/generate-graphql-schema/main.go
Normal 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())
|
||||
}
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue