mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-22 09:04: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
|
||||
|
||||
// TASK -> Update Analytics Image in Readme
|
||||
try {
|
||||
updatedGithubContent = updateAnalyticsImage(
|
||||
updatedGithubContent,
|
||||
secrets
|
||||
)
|
||||
} catch (e:Exception) {
|
||||
debug("Analytics Image Updation Failed",e.message.toString())
|
||||
}
|
||||
|
||||
// TASK -> Update Total Downloads Card
|
||||
try {
|
||||
updatedGithubContent = updateDownloadCards(
|
||||
updatedGithubContent,
|
||||
secrets.copy(tagName = "DCI")
|
||||
)
|
||||
} catch (e:Exception) {
|
||||
debug("Download Card Updation Failed",e.message.toString())
|
||||
}
|
||||
|
||||
// Write New Updated README.md
|
||||
GithubService.updateGithubFileContent(
|
||||
|
@ -54,12 +54,13 @@ internal suspend fun getAnalyticsImage(): String {
|
||||
}
|
||||
}
|
||||
contentLength = req.headers["Content-Length"]?.toLong() ?: 0
|
||||
debug(contentLength.toString())
|
||||
debug("Content Length for Analytics Image",contentLength.toString())
|
||||
|
||||
if(retryCount-- == 0){
|
||||
// FAIL Gracefully
|
||||
throw(RETRY_LIMIT_EXHAUSTED())
|
||||
}
|
||||
}while (contentLength<1_20_000)
|
||||
|
||||
return analyticsImage
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user