Skip to content
Snippets Groups Projects
Select Git revision
  • 47e634ab4efa0049bc28c6b3e1de33053ecdfd46
  • main default protected
  • v1.302.0
  • v1.301.0
  • v1.300.0
  • v1.299.0
  • v1.298.0
  • v1.297.0
  • v1.296.0
  • v1.295.0
  • v1.294.0
  • v1.293.0
  • v1.292.0
  • v1.291.0
  • v1.290.0
  • v1.289.0
  • v1.288.0
  • v1.287.0
  • v1.286.0
  • v1.285.0
  • v1.284.0
  • v1.283.0
22 results

cron.go

Blame
  • cron.go 709 B
    package handler_utils
    
    import (
    	"gitlab.com/uafrica/go-utils/errors"
    	"gitlab.com/uafrica/go-utils/logs"
    )
    
    // ValidateCronHandlers checks that all handlers are correctly defined using one of the supported handler types
    // return updated handlers (with additional information -> N/A for cron)
    func ValidateCronHandlers(handlers map[string]func() error) (map[string]func() error, error) {
    	countHandler := 0
    	for cronName, cronFunc := range handlers {
    		if cronName == "" {
    			return nil, errors.Errorf("blank handlerName")
    		}
    		if cronFunc == nil {
    			return nil, errors.Errorf("nil handler on %s", cronName)
    		}
    		countHandler++
    	}
    	logs.Info("Checked %d handlers\n", countHandler)
    	return handlers, nil
    }