Skip to content

Commit d51eb28

Browse files
committed
Givens
1 parent 14f8cd4 commit d51eb28

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

build.sbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ lazy val root = project
2424
libraryDependencies ++= Seq(
2525
// Config
2626
"com.monovore" %% "decline" % "2.2.0",
27-
"org.ini4j" % "ini4j" % "0.5.4",
27+
"org.ini4j" % "ini4j" % "0.5.4",
2828
// Http
29-
"com.lihaoyi" %% "requests" % "0.7.0" % Compile,
30-
"com.lihaoyi" %% "ujson" % "1.5.0" % Compile,
29+
"com.lihaoyi" %% "requests" % "0.7.0",
30+
"com.lihaoyi" %% "ujson" % "1.5.0",
3131
// Tests
3232
"org.scalactic" %% "scalactic" % "3.2.11",
3333
"org.scalatest" %% "scalatest" % "3.2.11" % Test,

src/main/scala/com/alhuelamo/databricks/jobmanager/Actions.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import scala.util.Try
77

88
object Actions {
99

10-
def stopActiveRuns(jobId: Long)(implicit conf: AppConf): Unit = {
10+
def stopActiveRuns(jobId: Long)(using conf: AppConf): Unit = {
1111
val ws = conf.databricksWs
1212
println(s"Stopping job $jobId")
1313

1414
Try {
1515
val activeRuns = DatabricksApi.getActiveJobRuns(jobId, ws)
1616
if (activeRuns.isEmpty)
17-
println(" no active runs found.")
17+
println(" no active runs found for this job.")
1818
else
1919
activeRuns.foreach(runId => cancelRun(runId, ws))
2020
} recover {
2121
jobNotFound
2222
}
2323
}
2424

25-
private def cancelRun(runId: Long, ws: DatabricksWorkspace)(implicit conf: AppConf): Unit = {
25+
private def cancelRun(runId: Long, ws: DatabricksWorkspace)(using conf: AppConf): Unit = {
2626
println(s" on run $runId")
2727

2828
if (!conf.plan) {
@@ -34,7 +34,7 @@ object Actions {
3434
}
3535
}
3636

37-
def startRuns(jobId: Long)(implicit conf: AppConf): Unit = {
37+
def startRuns(jobId: Long)(using conf: AppConf): Unit = {
3838
println(s"Starting job $jobId")
3939
if (!conf.plan) {
4040
Try {

src/main/scala/com/alhuelamo/databricks/jobmanager/Main.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object Main extends CommandApp(
99
header = "Databricks Job Manager",
1010
main = {
1111
Cli.opts.mapN { (action, profile, jobIds, plan) =>
12-
implicit val conf = AppConf(action, profile, jobIds, plan)
12+
given conf: AppConf = AppConf(action, profile, jobIds, plan)
1313

1414
conf.action match {
1515
case AppConf.`actionStart` => conf.jobIds.foreach(Actions.startRuns)

0 commit comments

Comments
 (0)