~netlandish/links

c113c1e960313b77010acb17d3aa5e9799b4a364 — Peter Sanchez 6 days ago 5cfb10e master
gobwebs bump and updates for custom worker pool size per queue
7 files changed, 31 insertions(+), 12 deletions(-)

M cmd/api/main.go
M cmd/global.go
M cmd/links/main.go
M cmd/list/main.go
M cmd/short/main.go
M go.mod
M go.sum
M cmd/api/main.go => cmd/api/main.go +1 -0
@@ 124,6 124,7 @@ func run() error {
		WithEmail(sq).
		WithStorage(storesvc).
		DefaultMiddlewareWithConfig(mwConf).
		SetWorkerPoolFunc(cmd.GetWorkerPoolCount).
		WithQueues(eq, wq).
		WithMiddleware(
			database.Middleware(db),

M cmd/global.go => cmd/global.go +15 -0
@@ 6,6 6,7 @@ import (
	"path/filepath"
	"testing"

	work "git.sr.ht/~sircmpwn/dowork"
	"petersanchez.com/x/migrate"
)



@@ 41,3 42,17 @@ func RunMigrations(t *testing.T, db *sql.DB) {
		t.Fatalf("Migrate() err = %v; want nil", err)
	}
}

// GetWorkerPoolCount will return the size of the worker pool based on the queue name
func GetWorkerPoolCount(queue *work.Queue) int {
	var pSize int
	switch queue.Name() {
	case "general":
		pSize = 10
	case "invoice":
		pSize = 3
	default:
		pSize = 5
	}
	return pSize
}

M cmd/links/main.go => cmd/links/main.go +1 -0
@@ 215,6 215,7 @@ func run() error {
		WithEmail(sq).
		WithStorage(storesvc).
		DefaultMiddlewareWithConfig(mwConf).
		SetWorkerPoolFunc(cmd.GetWorkerPoolCount).
		WithQueues(eq, wq, wqi).
		WithMiddleware(
			database.Middleware(db),

M cmd/list/main.go => cmd/list/main.go +1 -0
@@ 86,6 86,7 @@ func run() error {
		Initialize().
		WithAppInfo("links-list", Version).
		DefaultMiddlewareWithConfig(mwConf).
		SetWorkerPoolFunc(cmd.GetWorkerPoolCount).
		WithQueues(eq, wq).
		WithMiddleware(
			database.Middleware(db),

M cmd/short/main.go => cmd/short/main.go +1 -0
@@ 84,6 84,7 @@ func run() error {
		Initialize().
		WithAppInfo("links-short", Version).
		DefaultMiddlewareWithConfig(mwConf).
		SetWorkerPoolFunc(cmd.GetWorkerPoolCount).
		WithQueues(eq, wq).
		WithMiddleware(
			database.Middleware(db),

M go.mod => go.mod +4 -4
@@ 28,11 28,11 @@ require (
	golang.org/x/text v0.20.0
	golang.org/x/time v0.5.0
	hg.code.netlandish.com/~netlandish/sendygo v0.0.0-20230124192435-bbf347776232
	netlandish.com/x/gobwebs v0.0.0-20241219173153-b82c01404952
	netlandish.com/x/gobwebs-formguard v0.0.0-20240917220134-4b6f2ec7d1f5
	netlandish.com/x/gobwebs v0.0.0-20241220204303-8cc27ccc6753
	netlandish.com/x/gobwebs-formguard v0.0.0-20241220204736-317383081170
	netlandish.com/x/gobwebs-graphql v0.0.0-20241126234432-2cc59b2f7ebd
	netlandish.com/x/gobwebs-oauth2 v0.0.0-20240216010400-f0f42e2e3a7c
	netlandish.com/x/gobwebs-ses-feedback v0.0.0-20231224192331-d90c2b73e55d
	netlandish.com/x/gobwebs-oauth2 v0.0.0-20241220204404-89f1f20efe41
	netlandish.com/x/gobwebs-ses-feedback v0.0.0-20241220204650-1fb58398640c
	petersanchez.com/x/carrier v0.2.2
	petersanchez.com/x/carrier/ses v0.0.0-20240905233033-4a4ffeb71da4
	petersanchez.com/x/carrier/smtp v0.0.0-20240905233033-4a4ffeb71da4

M go.sum => go.sum +8 -8
@@ 2584,16 2584,16 @@ modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfp
modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
modernc.org/z v1.2.20/go.mod h1:zU9FiF4PbHdOTUxw+IF8j7ArBMRPsHgq10uVPt6xTzo=
modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4=
netlandish.com/x/gobwebs v0.0.0-20241219173153-b82c01404952 h1:DtzTNLe5MtlYVZuOT0zANWFddsRzM1np4FuMkA/Y0tU=
netlandish.com/x/gobwebs v0.0.0-20241219173153-b82c01404952/go.mod h1:Q/e3xSbcMqYMpYS360pz5gAA0/cCRrBxNHnCAYODHoA=
netlandish.com/x/gobwebs-formguard v0.0.0-20240917220134-4b6f2ec7d1f5 h1:z5hzVB0R+k2+bh8yuM7XeojGesI2i5tnQHrBNzxG2Xw=
netlandish.com/x/gobwebs-formguard v0.0.0-20240917220134-4b6f2ec7d1f5/go.mod h1:mmpJMveuFlwAj3URXlNmVox3WYCn4OVlozFQdd95wH8=
netlandish.com/x/gobwebs v0.0.0-20241220204303-8cc27ccc6753 h1:3htAHoDxML3oPrWUqUwB/xTNCwqKKs6Zmsd724EOTik=
netlandish.com/x/gobwebs v0.0.0-20241220204303-8cc27ccc6753/go.mod h1:Q/e3xSbcMqYMpYS360pz5gAA0/cCRrBxNHnCAYODHoA=
netlandish.com/x/gobwebs-formguard v0.0.0-20241220204736-317383081170 h1:iv47dRbi7yc1h2NhXVpescloOI+Bae/hqBNb1uw8jW4=
netlandish.com/x/gobwebs-formguard v0.0.0-20241220204736-317383081170/go.mod h1:t89MBCex25e8eHB4WlyXac/ss+8qJ2oZN8rCapYGBXQ=
netlandish.com/x/gobwebs-graphql v0.0.0-20241126234432-2cc59b2f7ebd h1:QJzQj/+2XAEHM0mCxqYleV0sVM2tNZBS6zP6uuOB+Tk=
netlandish.com/x/gobwebs-graphql v0.0.0-20241126234432-2cc59b2f7ebd/go.mod h1:HLqiAsZAamUcGy6bF8Vyt0eGXX2UhSl8oO1Z/vUoDlM=
netlandish.com/x/gobwebs-oauth2 v0.0.0-20240216010400-f0f42e2e3a7c h1:OiR7uZB8Ix33d6uZcNucqWC53XQlJLqH5MyskIaFD20=
netlandish.com/x/gobwebs-oauth2 v0.0.0-20240216010400-f0f42e2e3a7c/go.mod h1:YFuvoy5GEi60A+UfPZyC87DTAwFLrvUldZL6dr+ks1o=
netlandish.com/x/gobwebs-ses-feedback v0.0.0-20231224192331-d90c2b73e55d h1:Qof6jqwfFMcmw08Qh5UocDsqjNIvpsZwZuxGqhbh8GE=
netlandish.com/x/gobwebs-ses-feedback v0.0.0-20231224192331-d90c2b73e55d/go.mod h1:Sa3HY6qxvpiXAdQsBnMYPGNRO2OPYzxx+XwgfP6WrNc=
netlandish.com/x/gobwebs-oauth2 v0.0.0-20241220204404-89f1f20efe41 h1:SNhpXQS5kVQUMi4E3VdwJLq0uAdW/Q8VsU/F3WrkL7w=
netlandish.com/x/gobwebs-oauth2 v0.0.0-20241220204404-89f1f20efe41/go.mod h1:+AvlXsp4pIwzB92VWGMdtjUi5T5m7DMjthXOtp6obbY=
netlandish.com/x/gobwebs-ses-feedback v0.0.0-20241220204650-1fb58398640c h1:H/w1cGcFPOG0IgrdPbs19VfRnPM02JMgPEqQbeDfNh0=
netlandish.com/x/gobwebs-ses-feedback v0.0.0-20241220204650-1fb58398640c/go.mod h1:PQChMxEOJN17mcA392hgMf8zPtg7LI8nOkMqCkwYUaM=
petersanchez.com/x/carrier v0.2.2 h1:BVi4OAwQeVOw7lu9cSxoYmI/m0UEhfdXn3I8fGSVAd8=
petersanchez.com/x/carrier v0.2.2/go.mod h1:/9rUr2uuk8PlvhB5EtbCI64JzA8lTHoeeiapmDuVGKU=
petersanchez.com/x/carrier/ses v0.0.0-20240905233033-4a4ffeb71da4 h1:D4J3TzqpLoSMaiQeKqltWFphkUIke/rgpZZMJ3ghGhs=