1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00

GO-711 Remove wsId and injection goroutine

This commit is contained in:
kirillston 2023-04-25 18:17:59 +02:00 committed by Mikhail Iudin
parent 90826b3a1b
commit 6a66ad2c85
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
5 changed files with 778 additions and 825 deletions

View file

@ -654,7 +654,7 @@ func (mw *Middleware) ObjectWorkspaceSetDashboard(cctx context.Context, req *pb.
err error
)
err = mw.doBlockService(func(bs *block.Service) error {
if setId, err = bs.SetWorkspaceDashboardId(cctx, req.WorkspaceId, req.ObjectId); err != nil {
if setId, err = bs.SetWorkspaceDashboardId(cctx, req.ContextId, req.ObjectId); err != nil {
return err
}
return nil

View file

@ -11878,7 +11878,6 @@ Available undo/redo operations
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| contextId | [string](#string) | | |
| workspaceId | [string](#string) | | |
| objectId | [string](#string) | | |

File diff suppressed because it is too large Load diff

View file

@ -1469,8 +1469,7 @@ message Rpc {
message Request {
string contextId = 1;
string workspaceId = 2;
string objectId = 3;
string objectId = 2;
}
message Response {

View file

@ -50,6 +50,8 @@ var log = logging.Logger("anytype-mw-builtinobjects")
const (
analyticsContext = "get-started"
builtInDashboardObjectID = "bafybajhnav5nrikgey5hb6rwiq6j6mulyon3my4ehg3riia37cape4ru"
injectionTimeout = 30 * time.Second
)
func New() BuiltinObjects {
@ -91,12 +93,17 @@ func (b *builtinObjects) Run(context.Context) (err error) {
var ctx context.Context
ctx, b.cancel = context.WithCancel(context.Background())
go func() {
err = b.inject(ctx)
if err != nil {
log.Errorf("failed to import builtinObjects: %s", err.Error())
}
}()
start := time.Now()
err = b.inject(ctx)
if err != nil {
log.Errorf("failed to import builtinObjects: %s", err.Error())
}
spent := time.Now().Sub(start)
if spent > injectionTimeout {
log.Debugf("built-in objects injection time exceeded timeout of %s and is %s", injectionTimeout.String(), spent.String())
}
return
}