@@ -65,7 +65,7 @@ type systemDatabase interface {
6565type sysDB struct {
6666 pool * pgxpool.Pool
6767 notificationListenerConnection * pgconn.PgConn
68- notificationLoopDone chan bool
68+ notificationLoopDone chan struct {}
6969 notificationsMap * sync.Map
7070 logger * slog.Logger
7171 launched bool
@@ -104,7 +104,6 @@ func createDatabaseIfNotExists(ctx context.Context, databaseURL string, logger *
104104 return newInitializationError (fmt .Sprintf ("failed to check if database exists: %v" , err ))
105105 }
106106 if ! exists {
107- // TODO: validate db name
108107 createSQL := fmt .Sprintf ("CREATE DATABASE %s" , pgx.Identifier {dbName }.Sanitize ())
109108 _ , err = conn .Exec (ctx , createSQL )
110109 if err != nil {
@@ -225,7 +224,7 @@ func newSystemDatabase(ctx context.Context, databaseURL string, logger *slog.Log
225224 pool : pool ,
226225 notificationListenerConnection : notificationListenerConnection ,
227226 notificationsMap : notificationsMap ,
228- notificationLoopDone : make (chan bool ),
227+ notificationLoopDone : make (chan struct {} ),
229228 logger : logger ,
230229 }, nil
231230}
@@ -1363,7 +1362,7 @@ func (s *sysDB) sleep(ctx context.Context, duration time.Duration) (time.Duratio
13631362
13641363func (s * sysDB ) notificationListenerLoop (ctx context.Context ) {
13651364 defer func () {
1366- s .notificationLoopDone <- true
1365+ s .notificationLoopDone <- struct {}{}
13671366 }()
13681367
13691368 s .logger .Info ("DBOS: Starting notification listener loop" )
0 commit comments