🔊 Verbose updating image visibility
This commit is contained in:
parent
ef8759e51d
commit
86db065117
@ -499,12 +499,14 @@ func EditPost(item models.Post) (models.Post, error) {
|
|||||||
|
|
||||||
func updatePostAttachmentVisibility(item models.Post) error {
|
func updatePostAttachmentVisibility(item models.Post) error {
|
||||||
if item.Publisher.AccountID == nil {
|
if item.Publisher.AccountID == nil {
|
||||||
|
log.Warn().Msg("Post publisher did not have account id, skip updating attachments visibility...")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := item.Body["attachments"].([]string); ok && len(val) > 0 {
|
if val, ok := item.Body["attachments"].([]string); ok && len(val) > 0 {
|
||||||
conn, err := gap.Nx.GetClientGrpcConn("uc")
|
conn, err := gap.Nx.GetClientGrpcConn("uc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("An error occurred when getting grpc connection to Paperclip...")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,6 +518,11 @@ func updatePostAttachmentVisibility(item models.Post) error {
|
|||||||
UserId: lo.ToPtr(uint64(*item.Publisher.AccountID)),
|
UserId: lo.ToPtr(uint64(*item.Publisher.AccountID)),
|
||||||
IsIndexable: item.Visibility == models.PostVisibilityAll,
|
IsIndexable: item.Visibility == models.PostVisibilityAll,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Any("attachments", val).Err(err).Msg("An error occurred when updating post attachment visibility...")
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user