[MM-60152] Fix notifications log file location for Support Packet (#27921)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7232b5f002
Коммит
b5ac317e82
@@ -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")
|
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)
|
notificationsLogFileData, err := os.ReadFile(notificationsLog)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed read notifcation log file at path %s", notificationsLog)
|
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
|
// 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) {
|
th.Service.UpdateConfig(func(cfg *model.Config) {
|
||||||
*cfg.NotificationLogSettings.EnableFile = true
|
*cfg.NotificationLogSettings.EnableFile = true
|
||||||
*cfg.LogSettings.FileLocation = dir
|
*cfg.NotificationLogSettings.FileLocation = dir
|
||||||
})
|
})
|
||||||
|
|
||||||
logLocation := config.GetNotificationsLogFileLocation(dir)
|
logLocation := config.GetNotificationsLogFileLocation(dir)
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ func TestGenerateSupportPacket(t *testing.T) {
|
|||||||
|
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
*cfg.LogSettings.FileLocation = dir
|
*cfg.LogSettings.FileLocation = dir
|
||||||
|
*cfg.NotificationLogSettings.FileLocation = dir
|
||||||
})
|
})
|
||||||
|
|
||||||
logLocation := config.GetLogFileLocation(dir)
|
logLocation := config.GetLogFileLocation(dir)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user