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
Branches
Tags v0.1.2
No related merge requests found
......@@ -190,11 +190,7 @@ func (u *User) NewAuthKey() *AuthKey {
Secret: hex.EncodeToString(b),
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
}
......
......@@ -291,12 +291,11 @@ func main() {
}
authKey := &api.AuthKey{
KeyId: config.MustString("auth_key", *authKeyId),
Secret: config.MustString("auth_secret", *authKeySecret),
KeyId: *authKeyId,
Secret: *authKeySecret,
}
url := config.MustString("server_url", *serverUrl)
certPool := client.LoadCA()
client := util.NewHttpClient(url, authKey, certPool)
client := util.NewHttpClient(*serverUrl, authKey, certPool)
results := search(client, query)
if *fill > 0 {
......
......@@ -46,7 +46,7 @@ type PartitionedService interface {
GetPartitionCounters() map[string]int
SetPartitionCounters(map[string]int)
GetSelfTarget() string
Scan() chan string
Scan() <-chan string
Move(key string) error
}
......
......@@ -72,7 +72,7 @@ func (is *IndexService) Stop() {
is.quit <- true
}
func (is *IndexService) Scan() chan string {
func (is *IndexService) Scan() <-chan string {
ch := make(chan string)
idCh := make(chan api.SongID)
......
......@@ -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)
go func() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment