summaryrefslogtreecommitdiffstats
path: root/updates.go
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-08-08 00:29:57 -0700
committerraylu <raylu@mixpanel.com>2011-08-08 00:29:57 -0700
commit0164e2515ae5ff6cedf37c4ae8344eae4d1b9b94 (patch)
tree5c2b7ebd5349ebc6fe1be7059073f8fe19249d21 /updates.go
parente6b9900d3ba394eba04b84a8a01be644d43d642c (diff)
downloadaudioaxis-0164e2515ae5ff6cedf37c4ae8344eae4d1b9b94.tar.xz
dbpool!
Diffstat (limited to 'updates.go')
-rw-r--r--updates.go8
1 files changed, 7 insertions, 1 deletions
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