move implementations to external repos (#17)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-08-25 13:44:41 +03:00
committed by GitHub
parent c4a303190a
commit 0f4b1435d9
238 changed files with 151 additions and 37364 deletions

View File

@@ -1,9 +1,9 @@
package sync
import (
"fmt"
"time"
"github.com/pkg/errors"
"github.com/unistack-org/micro/v3/store"
)
@@ -32,11 +32,11 @@ func (c *syncStore) processQueue(index int) {
for i := 0; i < q.Len(); i++ {
r, ok := q.PopFront()
if !ok {
panic(errors.Errorf("retrieved an invalid value from the L%d sync queue", index+1))
panic(fmt.Errorf("retrieved an invalid value from the L%d sync queue", index+1))
}
ir, ok := r.(*internalRecord)
if !ok {
panic(errors.Errorf("retrieved a non-internal record from the L%d sync queue", index+1))
panic(fmt.Errorf("retrieved a non-internal record from the L%d sync queue", index+1))
}
if !ir.expiresAt.IsZero() && time.Now().After(ir.expiresAt) {
continue

View File

@@ -2,12 +2,12 @@
package sync
import (
"errors"
"fmt"
"sync"
"time"
"github.com/ef-ds/deque"
"github.com/pkg/errors"
"github.com/unistack-org/micro/v3/store"
)
@@ -59,7 +59,7 @@ func (c *syncStore) Init(opts ...store.Option) error {
}
for _, s := range c.syncOpts.Stores {
if err := s.Init(); err != nil {
return errors.Wrapf(err, "Store %s failed to Init()", s.String())
return fmt.Errorf("Store %s failed to Init(): %w", s.String(), err)
}
}
c.pendingWrites = make([]*deque.Deque, len(c.syncOpts.Stores)-1)