[MM-60152] Fix notifications log file location for Support Packet (#27921)

Этот коммит содержится в:
Ben Schumacher
2024-08-12 14:40:04 +02:00
коммит произвёл GitHub
родитель 7232b5f002
Коммит b5ac317e82
3 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@@ -230,7 +230,7 @@ func (ps *PlatformService) GetNotificationLogFile(_ request.CTX) (*model.FileDat
return nil, errors.New("Unable to retrieve notifications logs because NotificationLogSettings.EnableFile is set to false")
}
notificationsLog := config.GetNotificationsLogFileLocation(*ps.Config().LogSettings.FileLocation)
notificationsLog := config.GetNotificationsLogFileLocation(*ps.Config().NotificationLogSettings.FileLocation)
notificationsLogFileData, err := os.ReadFile(notificationsLog)
if err != nil {
return nil, errors.Wrapf(err, "failed read notifcation log file at path %s", notificationsLog)

Просмотреть файл

@@ -81,7 +81,7 @@ func TestGetNotificationLogFile(t *testing.T) {
// Enable notifications file but point to an empty directory to get an error trying to read the file
th.Service.UpdateConfig(func(cfg *model.Config) {
*cfg.NotificationLogSettings.EnableFile = true
*cfg.LogSettings.FileLocation = dir
*cfg.NotificationLogSettings.FileLocation = dir
})
logLocation := config.GetNotificationsLogFileLocation(dir)

Просмотреть файл

@@ -193,6 +193,7 @@ func TestGenerateSupportPacket(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.LogSettings.FileLocation = dir
*cfg.NotificationLogSettings.FileLocation = dir
})
logLocation := config.GetLogFileLocation(dir)