mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-02-06 09:54:48 +01:00
Compare commits
3 Commits
1a7ec5f339
...
49a2fcc138
Author | SHA1 | Date | |
---|---|---|---|
|
49a2fcc138 | ||
|
8f88e4f15a | ||
|
a1bb3b56fd |
@ -26,6 +26,13 @@ make docker
|
|||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
|
||||||
|
Actions are disabled by default, so you need to add the following to the configuration file of your Gitea instance to enable it:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[actions]
|
||||||
|
ENABLED=true
|
||||||
|
```
|
||||||
|
|
||||||
### Register
|
### Register
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -36,7 +43,7 @@ And you will be asked to input:
|
|||||||
|
|
||||||
1. Gitea instance URL, like `http://192.168.8.8:3000/`. You should use your gitea instance ROOT_URL as the instance argument
|
1. Gitea instance URL, like `http://192.168.8.8:3000/`. You should use your gitea instance ROOT_URL as the instance argument
|
||||||
and you should not use `localhost` or `127.0.0.1` as instance IP;
|
and you should not use `localhost` or `127.0.0.1` as instance IP;
|
||||||
2. Runner token, you can get it from `http://192.168.8.8:3000/admin/runners`;
|
2. Runner token, you can get it from `http://192.168.8.8:3000/admin/actions/runners`;
|
||||||
3. Runner name, you can just leave it blank;
|
3. Runner name, you can just leave it blank;
|
||||||
4. Runner labels, you can just leave it blank.
|
4. Runner labels, you can just leave it blank.
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ package poll
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
||||||
@ -55,9 +56,20 @@ func (p *Poller) poll(ctx context.Context, wg *sync.WaitGroup, limiter *rate.Lim
|
|||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err := p.runner.Run(ctx, task); err != nil {
|
p.runTaskWithRecover(ctx, task)
|
||||||
log.WithError(err).Error("failed to run task")
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Poller) runTaskWithRecover(ctx context.Context, task *runnerv1.Task) {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
err := fmt.Errorf("panic: %v", r)
|
||||||
|
log.WithError(err).Error("panic in runTaskWithRecover")
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
if err := p.runner.Run(ctx, task); err != nil {
|
||||||
|
log.WithError(err).Error("failed to run task")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user