MCPcopy
hub / github.com/rclone/rclone / newRun

Function newRun

backend/cache/cache_internal_test.go:807–834  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

805}
806
807func newRun() *run {
808 var err error
809 r := &run{
810 okDiff: time.Second * 9, // really big diff here but the build machines seem to be slow. need a different way for this
811 }
812
813 // Read in all the defaults for all the options
814 fsInfo, err := fs.Find("cache")
815 if err != nil {
816 panic(fmt.Sprintf("Couldn't find cache remote: %v", err))
817 }
818 r.runDefaultCfgMap = configmap.Simple{}
819 for _, option := range fsInfo.Options {
820 r.runDefaultCfgMap.Set(option.Name, fmt.Sprint(option.Default))
821 }
822
823 if uploadDir == "" {
824 r.tmpUploadDir, err = os.MkdirTemp("", "rclonecache-tmp")
825 if err != nil {
826 panic(fmt.Sprintf("Failed to create temp dir: %v", err))
827 }
828 } else {
829 r.tmpUploadDir = uploadDir
830 }
831 fs.Logf(nil, "Temp Upload Dir: %v", r.tmpUploadDir)
832
833 return r
834}
835
836func (r *run) encryptRemoteIfNeeded(t *testing.T, remote string) string {
837 if !runInstance.rootIsCrypt || len(decryptedToEncryptedRemotes) == 0 {

Callers 1

TestMainFunction · 0.70

Calls 3

FindFunction · 0.92
LogfFunction · 0.92
SetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…