2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-22 10:10:12 +00:00

removed future await and increased akka http timeout limit

This commit is contained in:
Jay07GIT 2024-07-23 16:54:30 +05:30
parent cb122b1506
commit 59fd320a5a
No known key found for this signature in database
GPG Key ID: AC6B0308EFC79008
8 changed files with 12 additions and 13 deletions

View File

@ -350,6 +350,7 @@ akka.http {
# The time period within which the TCP binding process must be completed. # The time period within which the TCP binding process must be completed.
# Set to `infinite` to disable. # Set to `infinite` to disable.
bind-timeout = 5s bind-timeout = 5s
request-timeout = 60s
# Show verbose error messages back to the client # Show verbose error messages back to the client
verbose-error-messages = on verbose-error-messages = on

View File

@ -347,6 +347,7 @@ akka.http {
# The time period within which the TCP binding process must be completed. # The time period within which the TCP binding process must be completed.
# Set to `infinite` to disable. # Set to `infinite` to disable.
bind-timeout = 5s bind-timeout = 5s
request-timeout = 60s
# Show verbose error messages back to the client # Show verbose error messages back to the client
verbose-error-messages = on verbose-error-messages = on

View File

@ -366,6 +366,7 @@ akka.http {
# The time period within which the TCP binding process must be completed. # The time period within which the TCP binding process must be completed.
# Set to `infinite` to disable. # Set to `infinite` to disable.
bind-timeout = 5s bind-timeout = 5s
request-timeout = 60s
# Show verbose error messages back to the client # Show verbose error messages back to the client
verbose-error-messages = on verbose-error-messages = on

View File

@ -351,6 +351,7 @@ akka.http {
# The time period within which the TCP binding process must be completed. # The time period within which the TCP binding process must be completed.
# Set to `infinite` to disable. # Set to `infinite` to disable.
bind-timeout = 5s bind-timeout = 5s
request-timeout = 60s
# Show verbose error messages back to the client # Show verbose error messages back to the client
verbose-error-messages = on verbose-error-messages = on

View File

@ -990,6 +990,7 @@ dotted-hosts = {
# The time period within which the TCP binding process must be completed. # The time period within which the TCP binding process must be completed.
# Set to `infinite` to disable. # Set to `infinite` to disable.
bind-timeout = 5s bind-timeout = 5s
request-timeout = 60s
# Show verbose error messages back to the client # Show verbose error messages back to the client
verbose-error-messages = on verbose-error-messages = on

View File

@ -29,10 +29,6 @@ import vinyldns.core.protobuf.{BatchChangeProtobufConversions, SingleChangeType}
import vinyldns.core.route.Monitored import vinyldns.core.route.Monitored
import vinyldns.proto.VinylDNSProto import vinyldns.proto.VinylDNSProto
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.DurationInt
import scala.concurrent.{Await, Future}
/** /**
* MySqlBatchChangeRepository implements the JDBC queries that support the APIs defined in BatchChangeRepository.scala * MySqlBatchChangeRepository implements the JDBC queries that support the APIs defined in BatchChangeRepository.scala
* BatchChange and SingleChange are stored in RDS as two tables. * BatchChange and SingleChange are stored in RDS as two tables.
@ -185,10 +181,9 @@ class MySqlBatchChangeRepository
.apply() .apply()
batchMeta.copy(changes = changes) batchMeta.copy(changes = changes)
} }
monitor("repo.BatchChangeJDBC.updateSingleChanges") {
def updateSingleChangeStatus(singleChanges: Seq[SingleChange]): Future[Option[BatchChange]] = { IO {
logger.info(s"Updating single change status: ${singleChanges.map(ch => (ch.id, ch.status))}") logger.info(s"Updating single change status: ${singleChanges.map(ch => (ch.id, ch.status))}")
Future {
DB.localTx { implicit s => DB.localTx { implicit s =>
for { for {
headChange <- singleChanges.headOption headChange <- singleChanges.headOption
@ -196,12 +191,10 @@ class MySqlBatchChangeRepository
_ = UPDATE_SINGLE_CHANGE.batchByName(batchParams: _*).apply() _ = UPDATE_SINGLE_CHANGE.batchByName(batchParams: _*).apply()
batchChange <- getBatchFromSingleChangeId(headChange.id) batchChange <- getBatchFromSingleChangeId(headChange.id)
} yield batchChange } yield batchChange
}}} }}
}
}
monitor("repo.BatchChangeJDBC.updateSingleChanges") {
IO {Await.result(updateSingleChangeStatus(singleChanges), 50.seconds)}
}
}
def getSingleChanges(singleChangeIds: List[String]): IO[List[SingleChange]] = def getSingleChanges(singleChangeIds: List[String]): IO[List[SingleChange]] =
if (singleChangeIds.isEmpty) { if (singleChangeIds.isEmpty) {
IO.pure(List()) IO.pure(List())

View File

@ -301,6 +301,7 @@ akka.http {
# The time period within which the TCP binding process must be completed. # The time period within which the TCP binding process must be completed.
# Set to `infinite` to disable. # Set to `infinite` to disable.
bind-timeout = 5s bind-timeout = 5s
request-timeout = 60s
# Show verbose error messages back to the client # Show verbose error messages back to the client
verbose-error-messages = on verbose-error-messages = on

View File

@ -359,7 +359,7 @@ akka.http {
# The time period within which the TCP binding process must be completed. # The time period within which the TCP binding process must be completed.
# Set to `infinite` to disable. # Set to `infinite` to disable.
bind-timeout = 5s bind-timeout = 5s
request-timeout = 60s
# Show verbose error messages back to the client # Show verbose error messages back to the client
verbose-error-messages = on verbose-error-messages = on
} }