Cron with 1 minute interval or calling a goroutine by demand?

Written by
Link to Post

https://www.reddit.com/r/golang/comments/adul4o/cron_with_1_minute_interval_or_calling_a/

On my main server/website I’ll need to move images to my other servers once they’ve been uploaded to my it. I have 2 solutions in mind:

1) cron, 1 minute interval. Check directories, copy and remove images one by one

2) goroutine invoked from my website once an image has been uploaded.

Both options will use “scp” to copy images to the remote servers.

“rsync” could also be used instead of “scp”, however, which of them isn’t what I focus on at the moment.

There’ll be approximately 10-20 images per days at most. Sometimes 1-3, or zero.

Which option – #1 or #2 – do you think is better?

submitted by /u/Jokkamo
[link] [comments]

Article Tags:
· ·
Article Categories:
reddit

Leave a Reply