From 0164e2515ae5ff6cedf37c4ae8344eae4d1b9b94 Mon Sep 17 00:00:00 2001 From: raylu Date: Mon, 8 Aug 2011 00:29:57 -0700 Subject: dbpool! --- updates.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'updates.go') diff --git a/updates.go b/updates.go index 33f12a9..28480c4 100644 --- a/updates.go +++ b/updates.go @@ -38,7 +38,13 @@ func addUpdate(pid int, action uint, song *Song) { tailUpdates[pid] = update } -func getUpdates(pid int, timestamp int64) *Update { +func getUpdates(id string, timestamp int64) *Update { + db := <-dbPool + pid := getpid(db, id) + dbPool <- db + if pid == -1 { + return nil + } pup, ok := headUpdates[pid] if !ok { return nil -- cgit v1.2.3