Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-25 11:16:11 +01:00

Add logging

This commit is contained in:
erik 2024-04-05 17:06:57 +02:00
parent 41f066a1a6
commit 33c60ebdff
2 changed files with 4 additions and 0 deletions

View file

@ -74,6 +74,9 @@ func RepositoryInbox(ctx *context.APIContext) {
form := web.GetForm(ctx)
httpStatus, title, err := federation.ProcessLikeActivity(ctx, form, repository.ID)
if err != nil {
log.Error("Status: %v", httpStatus)
log.Error("Title: %v", title)
log.Error("Error: %v", err)
ctx.Error(httpStatus, title, err)
}
ctx.Status(http.StatusNoContent)

View file

@ -252,6 +252,7 @@ func SendLikeActivities(ctx context.Context, doer user.User, repoID int64) error
likeActivityList := make([]forgefed.ForgeLike, 0)
for _, followingRepo := range followingRepos {
log.Info("Found following repo: %v", followingRepo)
target := followingRepo.URI
likeActivity, err := forgefed.NewForgeLike(doer.APAPIURL(), target, time.Now())
if err != nil {