Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Add test log for client ids. remove before production
Browse files Browse the repository at this point in the history
  • Loading branch information
cnevinc committed May 6, 2020
1 parent acdedea commit 8636821
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AdminPushAgentController @Inject constructor(
val result = addWorkRequest(input)
when (result) {
is AddWorkResponse.Success -> {
val msg = "MessageId [$mozMessageId] with title[$title] created [${result.jobCount}] jobs."
val msg = "MessageId [$mozMessageId] with title[$title] created [${result.jobCount}] jobs.<br>[Ids]<br>${result.debugStmo}"
logger.info("[push][enqueue]$msg")
return ResponseEntity(msg, HttpStatus.OK)
}
Expand All @@ -100,9 +100,11 @@ class AdminPushAgentController @Inject constructor(

private fun addWorkRequest(input: AdminPushAgentRequest): AddWorkResponse {

var debugStmo = StringBuffer()
val stmoResponse = stmoService.loadClientIds(input.stmoUrl)
val mozClientIds = when (stmoResponse) {
is StmoServiceResponse.Success -> {
stmoResponse.list.forEach { str -> debugStmo.append(str).append("<BR>") }
stmoResponse.list
}
is StmoServiceResponse.Error -> {
Expand Down Expand Up @@ -132,7 +134,7 @@ class AdminPushAgentController @Inject constructor(
pushDeepLink = input.pushDeepLink).toData()
addWork(data)
}
return AddWorkResponse.Success(messageQueueService.close())
return AddWorkResponse.Success(messageQueueService.close(), debugStmo.toString())
}

private fun addWork(data: String) {
Expand All @@ -151,6 +153,6 @@ class AdminPushAgentController @Inject constructor(
}

sealed class AddWorkResponse {
class Success(val jobCount: Int) : AddWorkResponse()
class Success(val jobCount: Int, val debugStmo: String) : AddWorkResponse()
class Error(val message: String) : AddWorkResponse()
}

0 comments on commit 8636821

Please sign in to comment.