adjust logging, catch rare ResponseItem panic for later
This commit is contained in:
parent
d925847734
commit
7004e3935c
|
@ -32,6 +32,12 @@ type ResponseItem struct {
|
|||
}
|
||||
|
||||
func NewResponseItem(cacheItem *CacheItem.Item) *ResponseItem {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Fatalf("Recovered from panic: %s - %s", r, cacheItem.Path)
|
||||
}
|
||||
}()
|
||||
|
||||
item := &ResponseItem{
|
||||
Path: cacheItem.Path,
|
||||
Name: cacheItem.Name,
|
||||
|
|
|
@ -27,6 +27,8 @@ func SyncThread() {
|
|||
ticker := time.NewTicker(time.Duration(config.GetConfig().ElasticsearchSyncInterval) * time.Second)
|
||||
fullSyncTicker := time.NewTicker(time.Duration(config.GetConfig().ElasticsearchFullSyncInterval) * time.Second)
|
||||
|
||||
log.Debugf("ELASTIC - started sync timers. Refresh: %d sec. Full: %d sec.", config.GetConfig().ElasticsearchSyncInterval, config.GetConfig().ElasticsearchFullSyncInterval)
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
|
|
Loading…
Reference in New Issue