Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/no-carrier.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <code@rebertia.com>2015-07-28 09:51:37 +0300
committerChris Rebert <code@rebertia.com>2015-07-28 09:54:58 +0300
commitea39fc8004f8e18f088087ef9b3c42392e4902b6 (patch)
tree6ddc6f3946c9c05372c0fdf6c35cd58e113b1bd9
parent7ee02ba6fc796c54cc02e47ba7bb3863b4d2494a (diff)
Log settings at start of session
-rw-r--r--src/main/scala/com/getbootstrap/no_carrier/Main.scala17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/scala/com/getbootstrap/no_carrier/Main.scala b/src/main/scala/com/getbootstrap/no_carrier/Main.scala
index 4da362c..7af1dd0 100644
--- a/src/main/scala/com/getbootstrap/no_carrier/Main.scala
+++ b/src/main/scala/com/getbootstrap/no_carrier/Main.scala
@@ -12,26 +12,30 @@ import com.getbootstrap.no_carrier.http.UserAgent
import com.getbootstrap.no_carrier.util._
case class Arguments(
- github: Github,
+ creds: Credentials,
repoId: RepoId,
label: String,
- timeout: Duration
-)
+ timeout: Duration,
+ rateLimitThreshold: Int
+) {
+ private implicit val userAgent = new UserAgent("NoCarrier/0.1 (https://github.com/twbs/no-carrier)")
+ lazy val github: Github = creds.github(rateLimitThreshold)
+}
object Main extends App with StrictLogging {
val enabled = false
implicit val clock = Clock.systemUTC
- implicit val userAgent = new UserAgent("NoCarrier/0.1 (https://github.com/twbs/no-carrier)")
val rateLimitThreshold = 10
val username = EnvVars.getRequired("GITHUB_USERNAME")
val password = EnvVars.getRequired("GITHUB_PASSWORD")
val arguments = (args.toSeq match {
case Seq(RepositoryId(repoId), NonEmptyStr(label), IntFromStr(PositiveInt(dayCount))) => {
Some(Arguments(
- Credentials(username = username, password = password).github(rateLimitThreshold),
+ Credentials(username = username, password = password),
repoId = repoId,
label = label,
- timeout = java.time.Duration.ofDays(dayCount)
+ timeout = java.time.Duration.ofDays(dayCount),
+ rateLimitThreshold = rateLimitThreshold
))
}
case _ => {
@@ -48,6 +52,7 @@ object Main extends App with StrictLogging {
val github = args.github
val rateLimit = github.rateLimit
val repo = github.repos.get(args.repoId)
+ logger.info(s"Repo(${args.repoId}), ${args.creds}, Label(${args.label}), Timeout(${args.timeout})")
val waitingOnOp = repo.issues.openWithLabel(args.label)
val opNeverDelivered = waitingOnOp.filter{ issue => {