diff --git a/loader/loader.go b/loader/loader.go index 65f13f6..749a893 100644 --- a/loader/loader.go +++ b/loader/loader.go @@ -11,8 +11,6 @@ import ( "github.com/seantcanavan/anon-eth-net/logger" ) -const TIME_BETWEEN_SUCCESSIVE_ITERATIONS = 60 - // Loader represents a struct that will load a set of processes and watch over // them. It knows the name of every process that it should be keeping an eye on // as well as how to resurrect that process should it no longer be executing. diff --git a/main/main.go b/main/main.go index c77e1d1..b5865b6 100644 --- a/main/main.go +++ b/main/main.go @@ -74,7 +74,7 @@ func main() { os.Exit(1) } - //------------------ CREATE REST INSTANCE TO ENABLE COMMUNIATION VIA REST ------------------ + //------------------ CREATE REST INSTANCE TO ENABLE COMMUNICATION VIA REST ------------------ certPath, certPathErr := utils.AssetPath("server.cert") if certPathErr != nil { fmt.Println(certPathErr) diff --git a/profiler/profiler.go b/profiler/profiler.go index 99443bb..ac902ff 100644 --- a/profiler/profiler.go +++ b/profiler/profiler.go @@ -7,7 +7,6 @@ import ( "fmt" "os" "time" - // "runtime" "github.com/seantcanavan/anon-eth-net/config" "github.com/seantcanavan/anon-eth-net/loader" @@ -16,12 +15,6 @@ import ( "github.com/seantcanavan/anon-eth-net/utils" ) -// the text to print after we finish executing a command so successive commands have some kind of visual break -const END_COMMAND_DIVIDER = "------------------------------------------------------------\n\n" - -// prof is short for profile and is the file extension we use after generating full system profiles -const PROFILE_FILE_EXTENSION = ".prof" - // the subject of the email that we use when sending out the profile const PROFILE_EMAIL_SUBJECT = "System Profile" @@ -131,19 +124,6 @@ func SendArchiveProfileAsAttachment() (*os.File, error) { return filePtr, reporter.SendAttachment(generateEmailSubject(), generateEmailBody(), filePtr) } -func beautifyTitle(title string) []byte { - var titleBuffer bytes.Buffer - - titleBuffer.WriteString("-------------------- ") - titleBuffer.WriteString(title) - titleBuffer.WriteString(" ") - for titleBuffer.Len() < 60 { - titleBuffer.WriteString("-") - } - - return titleBuffer.Bytes() -} - func generateEmailSubject() string { var buf bytes.Buffer buf.WriteString(PROFILE_EMAIL_SUBJECT) @@ -159,19 +139,13 @@ func generateEmailBody() []byte { } func Run() { - // kick off the system profiler loop to send out system profiles at the specified interval go func() { - for 1 == 1 { - logger.Lgr.LogMessage("Sleeping for %d seconds before sending a system profile", config.Cfg.CheckInFrequencySeconds) time.Sleep(time.Duration(config.Cfg.CheckInFrequencySeconds) * time.Second) logger.Lgr.LogMessage("Sending archive to provided email after sleeping %d seconds", config.Cfg.CheckInFrequencySeconds) SendArchiveProfileAsAttachment() - } - }() - } diff --git a/reporter/reporter_test.go b/reporter/reporter_test.go index bcdd030..e12cbc2 100644 --- a/reporter/reporter_test.go +++ b/reporter/reporter_test.go @@ -25,7 +25,6 @@ func TestMain(m *testing.M) { } result := m.Run() - // flush logs os.Exit(result) } diff --git a/rest/rest_test.go b/rest/rest_test.go index cbf678c..99ec9b0 100644 --- a/rest/rest_test.go +++ b/rest/rest_test.go @@ -23,7 +23,6 @@ var nowString string var protocol string var host string var port string -var publicKey string var transport *http.Transport var client *http.Client var restHandler *RestHandler diff --git a/utils/utils.go b/utils/utils.go index 6d8b984..00238ef 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -125,22 +125,6 @@ func ReadLines(path string) ([]string, error) { return lines, scanner.Err() } -// DirectoryList returns a list of entries in the given directory. It filters -// optionally for the given filter. -func DirectoryList(directoryName string, filter string) []string { - fileList := []string{} - _ = filepath.Walk(directoryName, func(path string, f os.FileInfo, err error) error { - if filter != "" { - if strings.Contains(path, filter) { - fileList = append(fileList, path) - } - } - return nil - }) - - return fileList -} - // credit to: https://gist.github.com/jniltinho/9788121 func ExternalIPAddress() (string, error) {