Skip to content

Commit

Permalink
Update pkg name
Browse files Browse the repository at this point in the history
  • Loading branch information
d1slike committed Apr 1, 2024
1 parent 12d9ae2 commit acab531
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 197 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
container: golang:1.17
container: golang:1.22
services:
postgres:
image: postgres
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# bgjob
![Build and test](https://github.com/integration-system/bgjob/actions/workflows/main.yml/badge.svg)
![Build and test](https://github.com/txix-open/bgjob/actions/workflows/main.yml/badge.svg)
[![codecov](https://codecov.io/gh/integration-system/bgjob/branch/master/graph/badge.svg?token=ZEX2Y8ZWKZ)](https://codecov.io/gh/integration-system/bgjob)
[![Go Report Card](https://goreportcard.com/badge/github.com/integration-system/bgjob)](https://goreportcard.com/report/github.com/integration-system/bgjob)
[![Go Report Card](https://goreportcard.com/badge/github.com/txix-open/bgjob)](https://goreportcard.com/report/github.com/txix-open/bgjob)

Tiny library to handle background jobs.

Expand All @@ -26,12 +26,10 @@ Highly inspired by [gue](https://github.com/vgarvardt/gue)
* You have a quite small load. Queues on database usually can handle around 1000 rps

## State
* API unstable and can be changed
* Library is not tested well, please use it in your production carefully
* Need to implement benchmarking and load tests
* The package has been used in production for 3 years with a small load

## Install
1. ```go get github.com/integration-system/bgjob```
1. ```go get github.com/txix-open/bgjob```
2. Add to your db migration tool sql from migration/init.sql

## Complete example
Expand All @@ -47,9 +45,9 @@ import (
"runtime"
"time"

_ "github.com/jackc/pgx/v4/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"

"github.com/integration-system/bgjob"
"github.com/txix-open/bgjob"
)

type Observer struct {
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"
"time"

"github.com/integration-system/bgjob"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
"github.com/txix-open/bgjob"
)

func TestClient_Enqueue(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion enqueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/integration-system/bgjob"
"github.com/txix-open/bgjob"
)

func TestEnqueueTxRollback(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"runtime"
"time"

_ "github.com/jackc/pgx/v4/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"

"github.com/integration-system/bgjob"
"github.com/txix-open/bgjob"
)

type Observer struct {
Expand Down
23 changes: 11 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
module github.com/integration-system/bgjob
module github.com/txix-open/bgjob

go 1.17
go 1.22

require (
github.com/jackc/pgx/v4 v4.16.1
github.com/jackc/pgx/v5 v5.5.5
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.1
github.com/stretchr/testify v1.9.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.12.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.11.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/text v0.3.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
189 changes: 20 additions & 169 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"testing"

_ "github.com/jackc/pgx/v4/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion type_mux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/integration-system/bgjob"
"github.com/txix-open/bgjob"
)

func TestMux(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"
"time"

"github.com/integration-system/bgjob"
"github.com/pkg/errors"
"github.com/txix-open/bgjob"
)

func TestWorker_Run(t *testing.T) {
Expand Down

0 comments on commit acab531

Please sign in to comment.