# HG changeset patch # User David Barts # Date 1722450078 25200 # Node ID 287eadf5ab30cb1e661a0060721646a9f40afb40 # Parent 3a3067ba673ba110bce45c9832d3f5af54a2f436 Check for timeouts inside subcommands while in interactive mode as well. diff -r 3a3067ba673b -r 287eadf5ab30 src/main/kotlin/name/blackcap/passman/Main.kt --- a/src/main/kotlin/name/blackcap/passman/Main.kt Sat Jul 27 09:50:54 2024 -0700 +++ b/src/main/kotlin/name/blackcap/passman/Main.kt Wed Jul 31 11:21:18 2024 -0700 @@ -78,6 +78,7 @@ lastStatus = 2 continue } + val beforeRun = System.currentTimeMillis() try { runSubcommand(subcommand, scArgs) lastStatus = 0 @@ -88,6 +89,11 @@ handleMessagedException(e) lastStatus = 1 } + if (System.currentTimeMillis() - beforeRun > MAX_TIME_MILLIS) { + error("time limit exceeded, goodbye!") + lastStatus = 1 + break + } } exitProcess(lastStatus) }