mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-22 17:14:32 +01:00
Maintenance Try/Catch
This commit is contained in:
parent
6dcbfd30b3
commit
ffbc3a5e0f
@ -20,16 +20,24 @@ fun main(args: Array<String>) {
|
|||||||
var updatedGithubContent: String = githubFileContent.decryptedContent
|
var updatedGithubContent: String = githubFileContent.decryptedContent
|
||||||
|
|
||||||
// TASK -> Update Analytics Image in Readme
|
// TASK -> Update Analytics Image in Readme
|
||||||
|
try {
|
||||||
updatedGithubContent = updateAnalyticsImage(
|
updatedGithubContent = updateAnalyticsImage(
|
||||||
updatedGithubContent,
|
updatedGithubContent,
|
||||||
secrets
|
secrets
|
||||||
)
|
)
|
||||||
|
} catch (e:Exception) {
|
||||||
|
debug("Analytics Image Updation Failed",e.message.toString())
|
||||||
|
}
|
||||||
|
|
||||||
// TASK -> Update Total Downloads Card
|
// TASK -> Update Total Downloads Card
|
||||||
|
try {
|
||||||
updatedGithubContent = updateDownloadCards(
|
updatedGithubContent = updateDownloadCards(
|
||||||
updatedGithubContent,
|
updatedGithubContent,
|
||||||
secrets.copy(tagName = "DCI")
|
secrets.copy(tagName = "DCI")
|
||||||
)
|
)
|
||||||
|
} catch (e:Exception) {
|
||||||
|
debug("Download Card Updation Failed",e.message.toString())
|
||||||
|
}
|
||||||
|
|
||||||
// Write New Updated README.md
|
// Write New Updated README.md
|
||||||
GithubService.updateGithubFileContent(
|
GithubService.updateGithubFileContent(
|
||||||
|
@ -54,12 +54,13 @@ internal suspend fun getAnalyticsImage(): String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
contentLength = req.headers["Content-Length"]?.toLong() ?: 0
|
contentLength = req.headers["Content-Length"]?.toLong() ?: 0
|
||||||
debug(contentLength.toString())
|
debug("Content Length for Analytics Image",contentLength.toString())
|
||||||
|
|
||||||
if(retryCount-- == 0){
|
if(retryCount-- == 0){
|
||||||
// FAIL Gracefully
|
// FAIL Gracefully
|
||||||
throw(RETRY_LIMIT_EXHAUSTED())
|
throw(RETRY_LIMIT_EXHAUSTED())
|
||||||
}
|
}
|
||||||
}while (contentLength<1_20_000)
|
}while (contentLength<1_20_000)
|
||||||
|
|
||||||
return analyticsImage
|
return analyticsImage
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user