You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: main.go
    path of file: ./repos/api-server/app/consumers
    
    the code of the file until where you have to start completion: package consumers

import (
	"github.com/go-redis/redis/v8"
	"github.com/pkg/errors"
	"math"
	"openscrm/app/constants"
	"openscrm/common/delay_queue"
	"openscrm/common/log"
	"ru
    
func ProtectedRun(topic constants.Topic, handler func(delay_queue.Job) error, fn func(topic constants.Topic, handler func(delay_queue.Job) error)) {
	// 延迟处理的函数
	defer func() {
		// 发生宕机时，获取panic传递的上下文并打印
		err := recover()
		switch err.(type) {
		case runtime.Error: // 运行时错误
			log.Sugar.Error("runtime error:", err)
		default: // 非运行时错误
			log.Sugar.Error("error:", err)
		}
	}()
	fn(topic, handler)
}