Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid buffering of output from PreRepositoryHook plugin?

scjung
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 12, 2024

I'm working on a PreRepositoryHook plugin that performs static analysis on pushed code.

Sometimes the analysis takes a long time, so the output from the analysis should be sent and displayed to the user immediately without any buffering.

But If i use PrintWriter from ScmHookDetails like the followings, the output is buffered and displayed all at once after the analysis is finished.

ScmHookDetails scmDetails = request.getScmHookDetails().get();
PrintWriter out = scmDetails.out();
out.println(...);
out.println(...);
out.flush(); // doesn't work
out.println(...);
out.println(...)


output:
$ git push
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
... takes long time without any output ...
remote: ...
remote: ...
remote: ...
remote: ..

 

Is there any solution to this?

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events