ugc.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package conf
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // UgcSync defines the params for ugc sync
  6. type UgcSync struct {
  7. Frequency *UgcFre
  8. Batch *Batch
  9. Cfg *UgcCfg
  10. }
  11. // UgcCfg is for various ugc cfg
  12. type UgcCfg struct {
  13. Copyright string
  14. ReportCidURL string // the url of VideoCloud for reporting Cid
  15. BFSPrefix string
  16. CriticalCid int64 // critical cid 12780000, under it no need to ask for transcoding
  17. ThreadLimit int64 // thread limit
  18. }
  19. // Batch is for the number of data to pick each time
  20. type Batch struct {
  21. ManualNum int // manually added archives
  22. ImportNum int // the number of uppers to import all his video
  23. ArcPS int // the page size to pick the upper's archives
  24. SyncPS int // the page size of sync message ( nb of videos )
  25. ReportCidPS int // the page size to update cid's mark status
  26. ProducerPS int // producer page size
  27. ReshelfPS int // reshelf arc page size
  28. }
  29. // UgcFre defines the ugc sync frequencies
  30. type UgcFre struct {
  31. ErrorWait int // postpone the operation due to error
  32. ManualFre xtime.Duration // re-check the manual import need frequency
  33. ImportFre xtime.Duration // import upper's video frequency
  34. TypesCron string // import the ugc types cron
  35. SyncFre xtime.Duration
  36. UpperRefresh xtime.Duration // upper refresh duration
  37. ReportCid xtime.Duration // 1 minute to check report cid
  38. UpInitFre xtime.Duration // pause between each page of upper's archive
  39. UpperPause xtime.Duration // pause between each import upper
  40. ProducerFre xtime.Duration // producer pause time
  41. FullRefreshFre xtime.Duration // video refresh frequency
  42. FullRefArcFre xtime.Duration // pause between each archive
  43. }