Skip to content
Snippets Groups Projects
Commit c19f2f79 authored by ale's avatar ale
Browse files

Merge branch 'master' of git.autistici.org:ale/djrandom

parents 68922a11 367fcde1
No related branches found
No related tags found
No related merge requests found
...@@ -190,11 +190,7 @@ func (u *User) NewAuthKey() *AuthKey { ...@@ -190,11 +190,7 @@ func (u *User) NewAuthKey() *AuthKey {
Secret: hex.EncodeToString(b), Secret: hex.EncodeToString(b),
User: u.Email, User: u.Email,
} }
if u.AuthKeyIds == nil {
u.AuthKeyIds = []string{key.KeyId}
} else {
u.AuthKeyIds = append(u.AuthKeyIds, key.KeyId) u.AuthKeyIds = append(u.AuthKeyIds, key.KeyId)
}
return key return key
} }
......
...@@ -291,12 +291,11 @@ func main() { ...@@ -291,12 +291,11 @@ func main() {
} }
authKey := &api.AuthKey{ authKey := &api.AuthKey{
KeyId: config.MustString("auth_key", *authKeyId), KeyId: *authKeyId,
Secret: config.MustString("auth_secret", *authKeySecret), Secret: *authKeySecret,
} }
url := config.MustString("server_url", *serverUrl)
certPool := client.LoadCA() certPool := client.LoadCA()
client := util.NewHttpClient(url, authKey, certPool) client := util.NewHttpClient(*serverUrl, authKey, certPool)
results := search(client, query) results := search(client, query)
if *fill > 0 { if *fill > 0 {
......
...@@ -46,7 +46,7 @@ type PartitionedService interface { ...@@ -46,7 +46,7 @@ type PartitionedService interface {
GetPartitionCounters() map[string]int GetPartitionCounters() map[string]int
SetPartitionCounters(map[string]int) SetPartitionCounters(map[string]int)
GetSelfTarget() string GetSelfTarget() string
Scan() chan string Scan() <-chan string
Move(key string) error Move(key string) error
} }
......
...@@ -72,7 +72,7 @@ func (is *IndexService) Stop() { ...@@ -72,7 +72,7 @@ func (is *IndexService) Stop() {
is.quit <- true is.quit <- true
} }
func (is *IndexService) Scan() chan string { func (is *IndexService) Scan() <-chan string {
ch := make(chan string) ch := make(chan string)
idCh := make(chan api.SongID) idCh := make(chan api.SongID)
......
...@@ -58,7 +58,7 @@ func NewStorageService(fsRoot string, authKey *api.AuthKey, pmap *partition.Part ...@@ -58,7 +58,7 @@ func NewStorageService(fsRoot string, authKey *api.AuthKey, pmap *partition.Part
} }
} }
func (ss *StorageService) Scan() chan string { func (ss *StorageService) Scan() <-chan string {
ch := make(chan string) ch := make(chan string)
go func() { go func() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment