             level     : -1   # the default
             cb        : undefined
         dbg = @_dbg("archive_patches(string_id='#{opts.string_id}')")
-        syncstring = patches = blob_uuid = project_id = undefined
+        syncstring = patches = blob_uuid = project_id = last_active =undefined
+        cutoff = misc.minutes_ago(30)
         where = {"string_id = $::CHAR(40)" : opts.string_id}
         async.series([
             (cb) =>
                 dbg("get project_id")
                 @_query
-                    query : "SELECT project_id, archived FROM syncstrings"
+                    query : "SELECT project_id, archived, last_active FROM syncstrings"
                     where : where
                     cb    : one_result (err, x) =>
                         if err

                            cb("already archived")
                        else
                            project_id = x.project_id
                            cb()
            (cb) =>
                dbg("get patches")
                @_query
                    query : "SELECT extract(epoch from time) as epoch, * FROM patches"

                            delete p.epoch
                        cb(err)
            (cb) =>
                if last_active? and last_active >= cutoff
                    cb(); return
                dbg("create blob from patches")
                try
                    blob = new Buffer(JSON.stringify(patches))
                catch err
                    # TODO: This *will* happen if the total length of all patches is too big.
                    cb(err)
                    return
                dbg('save blob')
                blob_uuid = misc_node.uuidsha1(blob)
                @save_blob
