Skip to content

Commit

Permalink
Merge pull request #129 from decert-me/chore/job-optimal
Browse files Browse the repository at this point in the history
Chore 优化定时任务程序,删除无用文件和函数
  • Loading branch information
0xdwong authored Mar 5, 2024
2 parents 6f1366f + 7a81213 commit 7219775
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 527 deletions.
16 changes: 0 additions & 16 deletions internal/job/cmd/config.demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,11 @@ contract:
badge: "0xaD1789A4cA2640a570a1268c84EA87e09A10A1f5"
quest: "0xd1E50047cEbaD1d826c3F7961A35048B518652F2"
quest-minter: "0xeb4E2EE6f165e7E1B9a4F1c4532C0433a6Ef397B"

# twitter configuration
twitter:
bear-token: ""

# scheduler configuration
scheduler:
active: true
airdrop-badge: "15 * * * *"

# ipfs configuration
ipfs:
api: "https://ipfs.io/ipfs/"

# discord configuration
discord:
active: true
token: "TzATY3NA.G3oGb.VryUgxsBM"
success-channel: "1105777577794211840"
failed-channel: "1105777577794211840"

contract-v2:
137:
badge: "0xaD1789A4cA2640a570a1268c84EA87e09A10A1f5"
Expand Down
4 changes: 0 additions & 4 deletions internal/job/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ type Config struct {
Pgsql *Pgsql `mapstructure:"pgsql" json:"pgsql" yaml:"pgsql"`
BlockChain *BlockChain `mapstructure:"blockchain" json:"blockchain" yaml:"blockchain"`
Contract *Contract `mapstructure:"contract" json:"contract" yaml:"contract"`
Twitter *Twitter `mapstructure:"twitter" json:"twitter" yaml:"twitter"`
Scheduler *Scheduler `mapstructure:"scheduler" json:"scheduler" yaml:"scheduler"`
IPFS *IPFS `mapstructure:"ipfs" json:"ipfs" yaml:"ipfs"`
Auth *Auth `mapstructure:"auth" json:"auth" yaml:"auth"`
Discord *Discord `mapstructure:"discord" json:"discord" yaml:"discord"`
ContractV2 map[int64]ContractV2 `mapstructure:"contract-v2" json:"contract-v2" yaml:"contract-v2"`
}
8 changes: 0 additions & 8 deletions internal/job/config/discord.go

This file was deleted.

6 changes: 0 additions & 6 deletions internal/job/config/scheduler.go

This file was deleted.

92 changes: 0 additions & 92 deletions internal/job/dao/claim_badge_tweet.go

This file was deleted.

92 changes: 0 additions & 92 deletions internal/job/dao/discord.go

This file was deleted.

2 changes: 0 additions & 2 deletions internal/job/service/badge_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ func (s *Service) handleClaimedV2(hash string, vLog *types.Log, chainID int64) (
log.Errorv("CreateChallenges error", zap.Any("challenges", challenges), zap.Error(err))
return err
}
// 如果有空投记录则删除
s.dao.UpdateAirdroppedError(tokenId, common.HexToAddress(vLog.Topics[2].Hex()).String(), "already claimed")
s.handleTraverseStatus(hash, 1, "")
return
}
2 changes: 1 addition & 1 deletion internal/job/service/quest.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (s *Service) handleModifyQuest(hash string, resJson []byte) (err error) {
Type: 0, // TODO
MetaData: []byte(metadata),
ExtraData: extraData,
Recommend: gjson.Get(tr.Params.String(), "recommend").Raw,
Recommend: gjson.Get(tr.Params.String(), "recommend").String(),
QuestData: []byte(questDataDetail),
}
if err = s.dao.UpdateQuest(&quest); err != nil {
Expand Down
Loading

0 comments on commit 7219775

Please sign in to comment.