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:
parent
90826b3a1b
commit
6a66ad2c85
5 changed files with 778 additions and 825 deletions
|
@ -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
|
||||
|
|
|
@ -11878,7 +11878,6 @@ Available undo/redo operations
|
|||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| contextId | [string](#string) | | |
|
||||
| workspaceId | [string](#string) | | |
|
||||
| objectId | [string](#string) | | |
|
||||
|
||||
|
||||
|
|
1578
pb/commands.pb.go
1578
pb/commands.pb.go
File diff suppressed because it is too large
Load diff
|
@ -1469,8 +1469,7 @@ message Rpc {
|
|||
|
||||
message Request {
|
||||
string contextId = 1;
|
||||
string workspaceId = 2;
|
||||
string objectId = 3;
|
||||
string objectId = 2;
|
||||
}
|
||||
|
||||
message Response {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue