Add debug logging to push mechanism

This commit is contained in:
Simon Detheridge 2021-07-08 12:16:07 +01:00
parent 5be3616109
commit c6d20faa34

View file

@ -451,6 +451,7 @@ public class Bridge {
RawDirectory oldDirectoryContents, RawDirectory oldDirectoryContents,
String hostname String hostname
) throws SnapshotPostException, IOException, MissingRepositoryException, ForbiddenException, GitUserException { ) throws SnapshotPostException, IOException, MissingRepositoryException, ForbiddenException, GitUserException {
Log.debug("[{}] pushing to Overleaf", projectName);
try (LockGuard __ = lock.lockGuard(projectName)) { try (LockGuard __ = lock.lockGuard(projectName)) {
pushCritical( pushCritical(
oauth2, oauth2,
@ -538,10 +539,11 @@ public class Bridge {
if (maxFileNum.isPresent()) { if (maxFileNum.isPresent()) {
long maxFileNum_ = maxFileNum.get(); long maxFileNum_ = maxFileNum.get();
if (directoryContents.getFileTable().size() > maxFileNum_) { if (directoryContents.getFileTable().size() > maxFileNum_) {
Log.debug("[{}] Too many files: {}/{}", projectName, directoryContents.getFileTable().size(), maxFileNum_);
throw new FileLimitExceededException(directoryContents.getFileTable().size(), maxFileNum_); throw new FileLimitExceededException(directoryContents.getFileTable().size(), maxFileNum_);
} }
} }
Log.info("[{}] Pushing", projectName); Log.info("[{}] Pushing files ({} new, {} old)", projectName, directoryContents.getFileTable().size(), oldDirectoryContents.getFileTable().size());
String postbackKey = postbackManager.makeKeyForProject(projectName); String postbackKey = postbackManager.makeKeyForProject(projectName);
Log.info( Log.info(
"[{}] Created postback key: {}", "[{}] Created postback key: {}",