fix(backend/storage): fixed panic in storage service

This commit is contained in:
Alexander Zavorotynskiy 2022-06-07 13:30:48 +02:00
parent 329ae62881
commit 4f8c4358f8
2 changed files with 6 additions and 0 deletions

View file

@ -26,6 +26,7 @@ func (e *AssetsCache) ParseAssets(sessID uint64, msg messages.Message) messages.
switch m := msg.(type) {
case *messages.SetNodeAttributeURLBased:
if m.Name == "src" || m.Name == "href" {
log.Printf("accet for session: %d", sessID)
return &messages.SetNodeAttribute{
ID: m.ID,
Name: m.Name,

View file

@ -40,12 +40,17 @@ func New(cfg *config.Config, s3 *storage.S3, metrics *monitoring.Metrics) (*Stor
if err != nil {
log.Printf("can't create session_size metric: %s", err)
}
archivingTime, err := metrics.RegisterHistogram("archiving_duration")
if err != nil {
log.Printf("can't create archiving_duration metric: %s", err)
}
return &Storage{
cfg: cfg,
s3: s3,
startBytes: make([]byte, cfg.FileSplitSize),
totalSessions: totalSessions,
sessionSize: sessionSize,
archivingTime: archivingTime,
}, nil
}