diff --git a/gql/resolver_versions.go b/gql/resolver_versions.go index e54a8f6d..df880909 100644 --- a/gql/resolver_versions.go +++ b/gql/resolver_versions.go @@ -100,6 +100,8 @@ func (r *mutationResolver) FinalizeCreateVersion(ctx context.Context, modID stri return false, errors.New("you must update your mod reference on the site to match your mod_reference in your data.json") } + log.Ctx(ctx).Info().Str("mod_id", mod.ID).Str("version_id", versionID).Msg("finalization gql call") + go func(ctx context.Context, mod *postgres.Mod, versionID string, version generated.NewVersion) { defer func() { if r := recover(); r != nil { @@ -111,12 +113,16 @@ func (r *mutationResolver) FinalizeCreateVersion(ctx context.Context, modID stri } }() + log.Ctx(ctx).Info().Str("mod_id", mod.ID).Str("version_id", versionID).Msg("calling FinalizeVersionUploadAsync") + data, err := FinalizeVersionUploadAsync(ctx, mod, versionID, version) if err2 := redis.StoreVersionUploadState(versionID, data, err); err2 != nil { log.Ctx(ctx).Err(err2).Msg("error storing redis state") return } + log.Ctx(ctx).Info().Str("mod_id", mod.ID).Str("version_id", versionID).Msg("finished FinalizeVersionUploadAsync") + if err != nil { log.Ctx(ctx).Err(err).Msgf("error completing version upload [%s]", versionID) } else { diff --git a/gql/versions.go b/gql/versions.go index dc04284a..254d7fcf 100644 --- a/gql/versions.go +++ b/gql/versions.go @@ -20,6 +20,9 @@ import ( ) func FinalizeVersionUploadAsync(ctx context.Context, mod *postgres.Mod, versionID string, version generated.NewVersion) (*generated.CreateVersionResponse, error) { + l := log.With().Str("mod_id", mod.ID).Str("version_id", versionID).Logger() + + l.Info().Msg("Creating multipart upload") success, _ := storage.CompleteUploadMultipartMod(ctx, mod.ID, mod.Name, versionID) if !success { @@ -163,6 +166,7 @@ func FinalizeVersionUploadAsync(ctx context.Context, mod *postgres.Mod, versionI go integrations.NewVersion(util.ReWrapCtx(ctx), dbVersion) } else { + l.Info().Msg("Submitting version job for virus scan") jobs.SubmitJobScanModOnVirusTotalTask(ctx, mod.ID, dbVersion.ID, true) } diff --git a/integrations/discord.go b/integrations/discord.go index 09e45354..8677487e 100644 --- a/integrations/discord.go +++ b/integrations/discord.go @@ -8,6 +8,7 @@ import ( "io" "io/ioutil" "net/http" + "runtime/debug" "strings" "github.com/satisfactorymodding/smr-api/db/postgres" @@ -79,6 +80,8 @@ func NewMod(ctx context.Context, mod *postgres.Mod) { } func NewVersion(ctx context.Context, version *postgres.Version) { + log.Ctx(ctx).Info().Str("stack", string(debug.Stack())).Msg("new version discord webhook") + if version == nil { return }