summaryrefslogtreecommitdiff
path: root/plugins/Irc/Irc_waiting_message.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Irc/Irc_waiting_message.php')
-rw-r--r--plugins/Irc/Irc_waiting_message.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/Irc/Irc_waiting_message.php b/plugins/Irc/Irc_waiting_message.php
index 05f72754c..59eec63d8 100644
--- a/plugins/Irc/Irc_waiting_message.php
+++ b/plugins/Irc/Irc_waiting_message.php
@@ -10,6 +10,7 @@ class Irc_waiting_message extends Memcached_DataObject {
public $id; // int primary_key not_null auto_increment
public $data; // blob not_null
public $prioritise; // tinyint(1) not_null
+ public $attempts; // int not_null
public $created; // datetime() not_null
public $claimed; // datetime()
@@ -112,6 +113,22 @@ class Irc_waiting_message extends Memcached_DataObject {
}
/**
+ * Increment the attempts count
+ *
+ * @return void
+ * @throws Exception
+ */
+ public function incAttempts() {
+ $orig = clone($this);
+ $this->attempts++;
+ $result = $this->update($orig);
+
+ if (!$result) {
+ throw Exception(sprintf(_m("Could not increment attempts count for %d"), $this->id));
+ }
+ }
+
+ /**
* Release a claimed item.
*/
public function releaseClaim() {