Skip to content

Commit

Permalink
don’t send webhooks for imported karas
Browse files Browse the repository at this point in the history
ignore imported karas for now, probably we could have an option later
when we support defining webhooks for more events
  • Loading branch information
odrling committed Nov 27, 2024
1 parent 56871c2 commit 3e96d60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,18 @@ func (ki *KaraInfoDB) AfterUpdate(tx *gorm.DB) error {
if err != nil {
return err
}

// ignore imported karas
mugen_import := &MugenImport{}
err := tx.Where(&MugenImport{KaraID: ki.ID}).First(mugen_import).Error
if err == nil {
// kara was imported
return nil
}
if !errors.Is(err, gorm.ErrRecordNotFound) {
return err
}

go PostWebhooks(*ki)
}
}
Expand Down

0 comments on commit 3e96d60

Please sign in to comment.