Skip to content

Commit ad7a6cd

Browse files
Update TODO references: #3, #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #16
1 parent cb8e670 commit ad7a6cd

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

cmd/worker/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func main() {
2525
mb := rabbitmq.NewRepository(cfg.MessageBroker.GetMessageBrokerUri(), rabbitClient)
2626
workerSvc := worker.NewWorkerService(mb, cfg)
2727

28-
// TODO [$609358567c9cf10008f93510]: this initiation should be handled by storage service
28+
// TODO [#3]: this initiation should be handled by storage service
2929
if _, err := os.Stat(worker.TmpPath); os.IsNotExist(err) {
3030
err = os.Mkdir(worker.TmpPath, 0700)
3131
if err != nil {
@@ -50,7 +50,7 @@ func main() {
5050
}
5151

5252
func (wrk *svc) processNewTask(newTaskData chan interface{}) {
53-
// TODO [$609358567c9cf10008f93511]: refactor ack and publish part of this loop
53+
// TODO [#4]: refactor ack and publish part of this loop
5454
for t := range newTaskData {
5555
msg := t.(amqp.Delivery)
5656
var task models.Task

pkg/apiserver/services/scheduler_logic.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (s schedulerServices) GetAllTaskProgress() (result []*models.TaskProgressRe
7474
}
7575
sort.Strings(keys)
7676

77-
// TODO [$609358567c9cf10008f93512]: create model for this return response
77+
// TODO [#5]: create model for this return response
7878
for _, k := range keys {
7979
originVideo := tempOriginVideo[k]
8080
result = append(result, &models.TaskProgressResponse{
@@ -179,7 +179,7 @@ func (s schedulerServices) CreateTranscodeTask(task *models.Task) error {
179179
go func(t *models.Task) {
180180
defer wg.Done()
181181

182-
// TODO [$609358567c9cf10008f93513]: add retry mechanism
182+
// TODO [#6]: add retry mechanism
183183
err := s.taskRepo.Add(t)
184184
if err != nil {
185185
log.Error(err)
@@ -354,7 +354,7 @@ func (s *schedulerServices) createSplitTask(video *models.Video, scheduler Sched
354354
var sizePerVid int64
355355
var sizeLeft int64
356356

357-
// TODO [$609358567c9cf10008f93514]: make the chunk file size is dynamic base on number of worker, worker failure rate, etc
357+
// TODO [#7]: make the chunk file size is dynamic base on number of worker, worker failure rate, etc
358358
// since lots of smaller task with same number of worker will just add overhead
359359
// in processing. The pros is, in case of pod failure in the middle of a processing,
360360
// the task that need to be re-processed is in smaller chunk. Currently I'll set this dynamically
@@ -367,7 +367,7 @@ func (s *schedulerServices) createSplitTask(video *models.Video, scheduler Sched
367367
minSize := int64(fileSize * 1e+6) // convert Megabyte to Byte
368368
// if video size less than min file size, forward to transcode task
369369
if video.Size < minSize {
370-
// TODO [$609358567c9cf10008f93515]: make this task definition not redundant.
370+
// TODO [#8]: make this task definition not redundant.
371371
// Task is re-defined on CreateTranscodeTask, but
372372
// this is a current workaround for preserve origin
373373
// video field, later please redesign the data models
@@ -464,7 +464,7 @@ func (s schedulerServices) updateTaskStatus(updateTaskStatusQueue chan interface
464464
}
465465

466466
func (s schedulerServices) scheduleTaskFromQueue(finishedTask chan interface{}) {
467-
// TODO [$609358567c9cf10008f93516]: Refactor this repetitive message ack
467+
// TODO [#9]: Refactor this repetitive message ack
468468
for t := range finishedTask {
469469
msg := t.(amqp.Delivery)
470470
var task models.Task

pkg/apiserver/services/worker_logic.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (wrk workerServices) workerStateUpdate(workerQueue chan interface{}, action
5050
if err != nil {
5151
log.Error(err)
5252
}
53-
// TODO [$609358567c9cf10008f93517]: add bulk upsert to reduce write
53+
// TODO [#10]: add bulk upsert to reduce write
5454
if err := wrk.workerRepo.Upsert(&worker); err != nil {
5555
log.Errorf("Worker %s failed to %s, err %s", worker.WorkerPodName, action, err)
5656
} else {
@@ -90,7 +90,7 @@ func (wrk workerServices) publishWorkerEvent() {
9090
if err != nil {
9191
log.Error(err)
9292
}
93-
// TODO [$609358567c9cf10008f93518]: only publish 1 data for every worker update
93+
// TODO [#11]: only publish 1 data for every worker update
9494
// instead off all worker result
9595
wrk.sse.Publish(WorkerHTTPEventStream, &sse.Event{
9696
Data: resp,

pkg/apiserver/util/healthcheck.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func MongoDBPingCheck(mongoClient *mongo.Client, timeout time.Duration) hc.Check
4545

4646
func RabbitPingCheck(connection *amqp.Connection) hc.Check {
4747
return func() error {
48-
// TODO [$609358567c9cf10008f93519]: try to reuse the channel instead of opening new channel everytime this endpoint got hit
48+
// TODO [#12]: try to reuse the channel instead of opening new channel everytime this endpoint got hit
4949
ch, err := connection.Channel()
5050
if err != nil {
5151
log.Errorf("failed to get rabbitmq channel: %s", err)

pkg/worker/merge.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (s Svc) ProcessTaskMerge(task *models.Task) error {
158158
}(f)
159159
}
160160
//Removing named pipe file
161-
// TODO [$609358567c9cf10008f9351a]: (improvement) make the pipe generic name (eg: temp1)
161+
// TODO [#13]: (improvement) make the pipe generic name (eg: temp1)
162162
// and can be reused to next process, might reducing io if the
163163
// created pipe file is a lot
164164
log.Debug("removing pipe file")

pkg/worker/worker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const (
2525

2626
type Svc struct {
2727
messageBroker repositories.Messenger
28-
// TODO [$609358567c9cf10008f9351b]: implement this storage repository
28+
// TODO [#14]: implement this storage repository
2929
storage repositories.StorageRepository
3030
worker *models.Worker
3131
config *config.Configuration

web/src/Pages/VideoPlayer/VideoTile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class VideoTile extends Component {
1414
// passed in `props` by a parent component
1515
this.props.setActiveVideo(this.props.video);
1616
}
17-
// TODO [$609358567c9cf10008f9351c]: add small thumbnail for each video
17+
// TODO [#15]: add small thumbnail for each video
1818
render() {
1919
return (
2020
<div className='videoTile' onClick={this.onClickVideoTile}>

web/src/Pages/Worker/WorkerPage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class WorkerPage extends Component {
1010
}
1111

1212

13-
// TODO [$609358567c9cf10008f9351d]: this stupid, need to apply websocket or sse
13+
// TODO [#16]: this stupid, need to apply websocket or sse
1414
// instead of requesting every 100ms
1515
async componentDidMount() {
1616
try {

0 commit comments

Comments
 (0)