Verified Commit fe57758c authored by meskio's avatar meskio 🏔️
Browse files

Don't mix up old and new telegram accounts

Old telegram accounts have smaller IDs and new ones have bigger IDs. The
logic was inversed here.
parent 4e9b2a40
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ func (d *TelegramDistributor) GetResources(id int64) []core.Resource {
	}

	pool := "new"
	if id >= d.cfg.MinUserID {
	if id < d.cfg.MinUserID {
		pool = "old"
		oldResources, err := d.oldHashring.GetMany(hashKey, d.cfg.NumBridgesPerRequest)
		if err != nil {
+2 −2
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@ func initDistributor() *TelegramDistributor {
}

func TestGetResources(t *testing.T) {
	newID := int64(10)
	oldID := int64(101)
	newID := int64(101)
	oldID := int64(10)

	d := initDistributor()
	defer d.Shutdown()