gogs / gogs

Gogs is a painless self-hosted Git service
https://gogs.io
MIT License
44.53k stars 4.84k forks source link

Send migrations to background #829

Open michaeldyrynda opened 9 years ago

michaeldyrynda commented 9 years ago

Hi there,

I just encountered an issue when importing a large (~300MB) repository from BitBucket to GoGits - basically the process timed out.

What I ended up doing was doing a git clone --mirror, but that then failed when I tried to do a git push --mirror (kept saying it was up to date). I got around this by overwriting the bare repository with my mirrored clone (and removing the 'is_bare' flag from the database).

Would it be possible / is it in the pipeline to background migration tasks (and possibly email the user when it's complete)?

unknwon commented 9 years ago

Hi @deringer , thanks your feedback!

This is true need for us, too.

michaeldyrynda commented 9 years ago

Fantastic - I won't need it again in the foreseeable future, but it would certainly be handy for the greater community.

unknwon commented 9 years ago

Sure thing.

dominikschulz commented 9 years ago

So far I don't see any mechanism for asynchronous background tasks in gogs (tasks, not just goroutines). Such a thing would be a good fit for any long-running operation and would help with this request, too.

unknwon commented 9 years ago

@gittex , am thinking on something called background worker.

xor-gate commented 8 years ago

We have experienced the same issue when mirroring a big repository (PHP source) from github to our internal gogs setup.

When a mirror is created it looks like it hangs, but gogs initially created the repository for the dashboard and suspended the clone to the background. Nothing is written to the browser after the POST request so the NGINX frontend will send a HTTP Status Timeout. Possible the mirror should be backgrounded and marked as "mirroring in progress". When done it should be "mirrored". Just like github does with cloning repositories can take some time and shows some progress.

The repository creation is also pushed to my profile dashboard and the link is created. When the mirroring is still in progress gogs shows HTTP 500 internal server error.

vivace-io commented 7 years ago

Any progress on this? Or does this issue need some love and a PR sent?

crazyzh1984 commented 4 years ago

Need this feature. Migration large repo time out.

unknwon commented 4 years ago

@crazyzh1984 that is a different problem, you need to increase migration timeout: https://github.com/gogs/gogs/blob/158dd33a2557bab406f7670a57be99d7dca9c3e3/conf/app.ini#L459