Cleanup: add and remove some comments

This commit is contained in:
Sybren A. Stüvel 2022-03-04 12:12:49 +01:00
parent 3bfd5a339f
commit f497ac8536
2 changed files with 3 additions and 1 deletions

View File

@ -60,7 +60,6 @@ func (db *DB) ScheduleTask(ctx context.Context, w *Worker) (*Task, error) {
}
// Found a task, now assign it to the requesting worker.
// Without the Select() call, Gorm will try and also store task.Job in the jobs database, which is not what we want.
if err := assignTaskToWorker(tx, w, task); err != nil {
logger.Warn().
Str("taskID", task.UUID).

View File

@ -47,6 +47,9 @@ func CreateTestDB(t *testing.T) (db *DB, closer func()) {
var err error
dblogger := NewDBLogger(log.Level(zerolog.InfoLevel).Output(os.Stdout))
// Open the database ourselves, so that we have a low-level connection that
// can be closed when the unit test is done running.
sqliteConn, err := sql.Open(sqlite.DriverName, TestDSN)
if err != nil {
t.Fatalf("opening SQLite connection: %v", err)