From 845ae1b353c0c753677239f447c21413588719c4 Mon Sep 17 00:00:00 2001 From: amanjpro Date: Wed, 26 Aug 2020 22:04:52 -0400 Subject: [PATCH 1/2] Always try to make the scratch-dir This is useful so that if the app is running and scratch-dir got erased Greenish stays functional --- src/main/scala/checker/checker.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/checker/checker.scala b/src/main/scala/checker/checker.scala index 1c2602b..c5911ac 100644 --- a/src/main/scala/checker/checker.scala +++ b/src/main/scala/checker/checker.scala @@ -15,6 +15,7 @@ package object checker { } def debugFile(scratchDir: File, groupId: Int, jobId: Int): String = { + scratchDir.mkdirs val fileName = scratchDir.toString / s"group-$groupId-job-$jobId-stdout.txt" fileName From 9cfdd810c9bd70e628c1e4d20371c8c62c8cab15 Mon Sep 17 00:00:00 2001 From: amanjpro Date: Wed, 26 Aug 2020 22:05:26 -0400 Subject: [PATCH 2/2] Always start with a clean scratch dir Fixes #71 --- src/main/scala/AppConfig.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/AppConfig.scala b/src/main/scala/AppConfig.scala index 62fc876..8e62538 100644 --- a/src/main/scala/AppConfig.scala +++ b/src/main/scala/AppConfig.scala @@ -19,7 +19,7 @@ object AppConfig { val port = appConfig.getInt("port") val namespace = Try(appConfig.getString("namespace")).toOption val scratchDir = new File(appConfig.getString("scratch-dir")) - scratchDir.mkdirs + scratchDir.delete val address = appConfig.getString("binding-address") new AppConfig(readEntries(appConfig), namespace, scratchDir, refreshRate, address, port)