mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-31 18:10:50 +01:00
加入Git同步
This commit is contained in:
@@ -53,6 +53,7 @@ type Spider struct {
|
||||
GitPassword string `json:"git_password" bson:"git_password"` // Git 密码
|
||||
GitAutoSync bool `json:"git_auto_sync" bson:"git_auto_sync"` // Git 是否自动同步
|
||||
GitSyncFrequency string `json:"git_sync_frequency" bson:"git_sync_frequency"` // Git 同步频率
|
||||
GitSyncError string `json:"git_sync_error" bson:"git_sync_error"` // Git 同步错误
|
||||
|
||||
// 前端展示
|
||||
LastRunTs time.Time `json:"last_run_ts"` // 最后一次执行时间
|
||||
@@ -166,6 +167,15 @@ func GetSpiderList(filter interface{}, skip int, limit int, sortStr string) ([]S
|
||||
return spiders, count, nil
|
||||
}
|
||||
|
||||
// 获取所有爬虫列表
|
||||
func GetSpiderAllList(filter interface{}) (spiders []Spider, err error) {
|
||||
spiders, _, err = GetSpiderList(filter, 0, constants.Infinite, "_id")
|
||||
if err != nil {
|
||||
return spiders, err
|
||||
}
|
||||
return spiders, nil
|
||||
}
|
||||
|
||||
// 获取爬虫(根据FileId)
|
||||
func GetSpiderByFileId(fileId bson.ObjectId) *Spider {
|
||||
s, c := database.GetCol("spiders")
|
||||
|
||||
Reference in New Issue
Block a user