Skip to content

Commit

Permalink
Enquanto der erro de upload, reduz o tamanho do arquivo a 75%
Browse files Browse the repository at this point in the history
  • Loading branch information
afsmaira committed May 29, 2024
1 parent 8ccc18b commit 9e7c8f5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/grade.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ def main():
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT).stdout
os.remove(GRADER_EXEC)
repo.create_file(path=os.path.join(GRADER_FOLDER, log_file),
message=f'task "{task}" grader [skip ci]',
content=log[:10000000]
)
tam = len(log)
while True:
try:
repo.create_file(path=os.path.join(GRADER_FOLDER, log_file),
message=f'task "{task}" grader [skip ci]',
content=log[:tam]
)
break
except Exception as err:
print(err)
tam = tam * 3 // 4
log = str(log, encoding='utf8')
print(log)
score = log.strip().splitlines()
Expand Down

0 comments on commit 9e7c8f5

Please sign in to comment.