There are two issues with my script: It doesn't update random every new round and keeps running forever. But in my opinion it should do both .. How can I make the loop recognize that this.short has changed?
while ( ! this.short) {
random = Math.random().toString(36).substring(2,7).toUpperCase();
dpd.links.get({short: random}, function(res, err) {
if (err)
cancel('Error', 500);
if ( ! res.length)
this.short = random;
});
}