Skip to content

Commit

Permalink
refacor: add subtask register
Browse files Browse the repository at this point in the history
  • Loading branch information
chenggui53 committed Jun 22, 2023
1 parent e2e7fac commit 0e2daef
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions backend/plugins/feishu/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
"github.com/apache/incubator-devlake/helpers/pluginhelper/subtaskmeta_sorter"
"github.com/apache/incubator-devlake/plugins/feishu/api"
"github.com/apache/incubator-devlake/plugins/feishu/models"
"github.com/apache/incubator-devlake/plugins/feishu/models/migrationscripts"
Expand All @@ -43,16 +42,6 @@ var _ interface {
plugin.CloseablePluginTask
} = (*Feishu)(nil)

var sortedSubtaskPlugins []plugin.SubTaskMeta

func init() {
var err error
sortedSubtaskPlugins, err = subtaskmeta_sorter.NewTableSorter(tasks.SubtaskMetas).Sort()
if err != nil {
panic(err)
}
}

type Feishu struct{}

func (p Feishu) Init(basicRes context.BasicRes) errors.Error {
Expand Down Expand Up @@ -89,7 +78,16 @@ func (p Feishu) ScopeConfig() dal.Tabler {
}

func (p Feishu) SubTaskMetas() []plugin.SubTaskMeta {
return sortedSubtaskPlugins
return []plugin.SubTaskMeta{
tasks.CollectChatMeta,
tasks.ExtractChatItemMeta,

tasks.CollectMessageMeta,
tasks.ExtractMessageMeta,

tasks.CollectMeetingTopUserItemMeta,
tasks.ExtractMeetingTopUserItemMeta,
}
}

func (p Feishu) PrepareTaskData(taskCtx plugin.TaskContext, options map[string]interface{}) (interface{}, errors.Error) {
Expand Down

0 comments on commit 0e2daef

Please sign in to comment.