Skip to content
Snippets Groups Projects
Commit 6a9e37d7 authored by David Trattnig's avatar David Trattnig
Browse files

Clear filesystem A and B.

parent cd7702ea
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,9 @@
input_filesystem_0 = request.equeue(id="in_filesystem_0")
input_filesystem_1 = request.equeue(id="in_filesystem_1")
input_filesystem_2 = request.equeue(id="in_filesystem_2")
input_filesystem_3 = request.equeue(id="in_filesystem_3")
input_filesystem_4 = request.equeue(id="in_filesystem_4")
# input_filesystem_2 = request.equeue(id="in_filesystem_2")
# input_filesystem_3 = request.equeue(id="in_filesystem_3")
# input_filesystem_4 = request.equeue(id="in_filesystem_4")
#input_fs = cue_cut(mksafe(request.equeue(id="fs")))
......@@ -57,26 +57,34 @@ input_filesystem_4 = request.equeue(id="in_filesystem_4")
# fun (s) -> begin clear_queue(input_fs) "Done." end)
def clear_items(s) =
ret = server.execute("fs.primary_queue")
def clear_items(ns) =
ret = server.execute("#{source.id(ns)}.primary_queue")
ret = list.hd(default="", ret)
if ret == "" then
log("Queue cleared.")
(-1.)
else
log("There are still items in the queue, trying skip ...")
source.skip(s)
source.skip(ns)
(0.1)
end
end
def clear_queue(s) =
add_timeout(fast=false, 0.5, {clear_items(s)})
def clear_queue(ns) =
add_timeout(fast=false, 0.5, {clear_items(ns)})
end
server.register(namespace="fs",
description="Clear all items of the filesystem queue.",
usage="clear",
"clear",
fun (s) -> begin clear_queue(input_fs) "Done." end)
# Clear Queue 0
server.register(namespace=source.id(input_filesystem_0),
description="Clear all items of the filesystem Queue A.",
usage="clear",
"clear_filesystem_0",
fun (s) -> begin clear_queue(input_filesystem_0) "Done." end)
# Clear Queue 1
server.register(namespace=source.id(input_filesystem_1),
description="Clear all items of the filesystem Queue B.",
usage="clear",
"clear_filesystem_1",
fun (s) -> begin clear_queue(input_filesystem_1) "Done." end)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment