コード例 #1
0
        private async Task <IReadOnlyList <GitHubCommit> > GetGitHubCommitsOrNull(Project project, string documentName, string languageCode, string version)
        {
            /*
             * Getting file commits usually throws "Resource temporarily unavailable" or "Network is unreachable"
             * This is a trival information and running this inside try-catch is safer.
             */

            try
            {
                return(await GetFileCommitsAsync(project, version, project.GetGitHubInnerUrl(languageCode, documentName)));
            }
            catch (Exception e)
            {
                Logger.LogError(e.ToString());
                return(null);
            }
        }
コード例 #2
0
 private async Task <DateTime?> GetLastKnownSignificantUpdateTime(
     Project project,
     string documentName,
     string languageCode,
     string version,
     DateTime?lastKnownSignificantUpdateTime,
     bool isNavigationDocument,
     bool isParameterDocument,
     IReadOnlyList <GitHubCommit> commits,
     DateTime documentCreationTime)
 {
     return(!isNavigationDocument && !isParameterDocument && version == project.LatestVersionBranchName
         ? await GetLastSignificantUpdateTime(
                commits,
                project,
                project.GetGitHubInnerUrl(languageCode, documentName),
                lastKnownSignificantUpdateTime,
                documentCreationTime
                ) ?? lastKnownSignificantUpdateTime
         : null);
 }