You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I do Find(&obj) in contex cancelled state, it falls into panic state. This situation started to occur with v1.25.11.
Example code:
func (pPlaylistRepository) GetPlaylistItemsByPlaylistID(ctx context.Context, iduint, limit, offsetint) (result*models.PlaylistItemWithMediaList, errerror) {
var (
dbPlaylistItems []dbmodels.PlaylistItemWithMediacountint64
)
iferr=p.db.WithContext(ctx).
Select(
"pi.created_at as item_created_at",
"pi.detail as item_detail",
"pi.id as item_id",
"pi.\"order\" as item_order",
"pi.playlist_id as item_playlist_id",
"pi.fixed as item_fixed",
"m.id as media_id",
"m.uuid as media_uuid",
"m.ext as media_ext",
"m.url as media_url",
"m.thumbnail as media_thumbnail",
"m.title as media_title",
"m.type as media_type",
"m.storage_type as media_storage_type",
"m.size as media_size",
"m.customer_id as media_customer_id",
"m.user_id as user_id",
"m.info as media_info",
"m.checksum as media_checksum",
"u.full_name as user_full_name",
"u.job_title as user_job_title",
"u.email as user_email",
"u.mobile_number as user_mobile_number",
"u.department as user_department",
).
Table("playlist_items pi").
Joins(
"left join media m on m.id = pi.media_id ""left join users u on m.user_id = u.id",
).
Where("pi.playlist_id = ?", id).
Count(&count).Limit(limit).Offset(offset).
Find(&dbPlaylistItems).Error; err!=nil {
err=fmt.Errorf("get playlist items by playlist id / find : %w", err)
return
}
playlistItems:=make([]*models.PlaylistItemWithMedia, 0, len(dbPlaylistItems))
fori:=rangedbPlaylistItems {
varpm*models.PlaylistItemWithMediaifpm, err=dbPlaylistItems[i].To(); err!=nil {
err=fmt.Errorf("get playlist items by playlist id / convert to : %w", err)
return
}
playlistItems=append(playlistItems, pm)
}
result=&models.PlaylistItemWithMediaList{
Items: playlistItems,
Count: count,
Limit: limit,
Offset: offset,
}
return
}
The text was updated successfully, but these errors were encountered:
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
ozkansen
changed the title
When I do Find(&obj) in contex cancelled state, it falls into panic state
When I do Find(&obj) in contex cancelled state, it falls into panic state v1.25.11
Jul 22, 2024
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
When I do Find(&obj) in contex cancelled state, it falls into panic state. This situation started to occur with v1.25.11.
Example code:
The text was updated successfully, but these errors were encountered: