I hereby claim:
- I am sanderploegsma on github.
- I am sanderp (https://keybase.io/sanderp) on keybase.
- I have a public key ASCeL-IVd_AzlnZlHwps27TSVke0LroY4h9JGAc3Okcsmwo
To claim this, I am signing this object:
[alias] | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
st = status | |
co = checkout | |
cm = commit | |
cp = cherry-pick | |
cl = !sh -c \"git branch --merged master | grep -v -e 'master' -e '\\*' | xargs -n 1 git branch -d && git remote prune origin\" | |
up = !sh -c \"git push && git push --tags\" | |
br = branch |
// waitUntilQueueEmpty subscribes on the queue and returns when no messages arrive for more than 5 seconds | |
// all received messages are not acknowledged in order to return them to the queue so that workers can process them | |
func (m *master) waitUntilQueueEmpty(ctx context.Context, sub *pubsub.Subscription) error { | |
// Use cancellable context for the subscription | |
ctx, cancelSubscribe := context.WithCancel(ctx) | |
messageReceived := make(chan bool) | |
go func() { | |
// keep checking if we received a message in the last 5 seconds | |
// if not, cancel the subscription | |
for { |
// waitUntilQueueEmpty subscribes on the queue and returns when no messages arrive for more than 5 seconds | |
// all received messages are not acknowledged in order to return them to the queue so that workers can process them | |
func (m *master) waitUntilQueueEmpty(ctx context.Context, sub *pubsub.Subscription) error { | |
var mu sync.Mutex | |
lastMessageTimestamp := time.Now() | |
// Use cancellable context for the subscription | |
ctx, cancelSubscribe := context.WithCancel(ctx) | |
// Check if the last message was received more than 5 seconds ago. If so, cancel the subscription context | |
go func() { | |
for { |
apiVersion: apps/v1beta1 | |
kind: StatefulSet | |
metadata: | |
name: redis-cluster | |
labels: | |
app: redis-cluster | |
spec: | |
serviceName: redis-cluster | |
replicas: 6 | |
selector: |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# up.sh by Sander Ploegsma (@sanderploegsma) | |
# | |
# Copy file to remote location using generated filename. Return file link and copy to clipboard | |
# NOTE: Currently only meant for OS X due to use of pbcopy. | |
# | |
REMOTE_USER="username" | |
REMOTE_URL="example.com" | |
REMOTE_PATH="/path/to/files" | |
LINK_BASE="http://my.short.url/" |
#! /bin/bash | |
# postdownload.sh by Sander Ploegsma | |
{ | |
CP_API_KEY="apikeyhere" | |
CP_HOST="<ip>:<port>" | |
echo $(date +%Y-%m-%d\ %H:%M:%S) "Forcing CouchPotato rescan..." | |
curl --silent -X POST "http://$CP_HOST/api/$CP_API_KEY/renamer.scan" > /dev/null | |
echo $(date +%Y-%m-%d\ %H:%M:%S) "Done." | |
} |