-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement experiments flag and size_time_check experiment, that copie…
…s and deletes files based on size and modification time of both source and target directories
- Loading branch information
Showing
5 changed files
with
190 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package regolith | ||
|
||
type Experiment int | ||
|
||
const ( | ||
// SizeTimeCheck is an experiment that checks the size and modification time when exporting | ||
SizeTimeCheck Experiment = iota | ||
) | ||
|
||
var experimentNames = map[Experiment]string{ | ||
SizeTimeCheck: "size_time_check", | ||
} | ||
|
||
var EnabledExperiments []string | ||
|
||
func IsExperimentEnabled(exp Experiment) bool { | ||
if EnabledExperiments == nil { | ||
return false | ||
} | ||
for _, e := range EnabledExperiments { | ||
if e == experimentNames[exp] { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters