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
|
var updatedGithubContent: String = githubFileContent.decryptedContent
|
||||||
|
|
||||||
// TASK -> Update Analytics Image in Readme
|
// TASK -> Update Analytics Image in Readme
|
||||||
updatedGithubContent = updateAnalyticsImage(
|
try {
|
||||||
updatedGithubContent,
|
updatedGithubContent = updateAnalyticsImage(
|
||||||
secrets
|
updatedGithubContent,
|
||||||
)
|
secrets
|
||||||
|
)
|
||||||
|
} catch (e:Exception) {
|
||||||
|
debug("Analytics Image Updation Failed",e.message.toString())
|
||||||
|
}
|
||||||
|
|
||||||
// TASK -> Update Total Downloads Card
|
// TASK -> Update Total Downloads Card
|
||||||
updatedGithubContent = updateDownloadCards(
|
try {
|
||||||
updatedGithubContent,
|
updatedGithubContent = updateDownloadCards(
|
||||||
secrets.copy(tagName = "DCI")
|
updatedGithubContent,
|
||||||
)
|
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