Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func handleDownloaderModify(ctxArg interface{}, objType string,
- key string, configArg interface{}) {
- log.Infof("handleDownloaderModify(%s)\n", key)
- ctx := ctxArg.(*downloaderContext)
- config := cast.CastDownloaderConfig(configArg)
- if config.Key() != key {
- log.Errorf("handleDownloaderModify key/UUID mismatch %s vs %s; ignored %+v\n",
- key, config.Key(), config)
- return
- }
- h, ok := handlerMap[config.Key()]
- if !ok {
- log.Fatalf("handleDownloaderModify called on config that does not exist")
- }
- h <- configArg
- }
- func handleDownloaderCreate(ctxArg interface{}, objType string,
- key string, configArg interface{}) {
- log.Infof("handleDownloaderModify(%s)\n", key)
- ctx := ctxArg.(*downloaderContext)
- config := cast.CastDownloaderConfig(configArg)
- if config.Key() != key {
- log.Errorf("handleDownloaderModify key/UUID mismatch %s vs %s; ignored %+v\n",
- key, config.Key(), config)
- return
- }
- h, ok := handlerMap[config.Key()]
- if ok {
- log.Fatalf("handleDownloaderCreate called on config that already exists")
- }
- h := make(chan interface{})
- handlerMap[config.Key()] = h
- go runHandler(ctx, objType, key, h)
- h <- configArg
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement