func enablePre()

in main/cmds.go [93:104]


func enablePre(ctx *log.Context, hEnv HandlerEnvironment, seqNum int) error {
	// exit if this sequence number (a snapshot of the configuration) is already
	// processed. if not, save this sequence number before proceeding.
	if shouldExit, err := checkAndSaveSeqNum(ctx, seqNum, mostRecentSequence); err != nil {
		return errors.Wrap(err, "failed to process sequence number")
	} else if shouldExit {
		ctx.Log("event", "exit", "message", "the script configuration has already been processed, will not run again")
		clearSettingsAndScriptExceptMostRecent(seqNum, ctx, hEnv)
		os.Exit(0)
	}
	return nil
}