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

Clear filesystem A and B.

parent c98739b7
No related branches found
No related tags found
No related merge requests found
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
input_filesystem_0 = request.equeue(id="in_filesystem_0") input_filesystem_0 = request.equeue(id="in_filesystem_0")
input_filesystem_1 = request.equeue(id="in_filesystem_1") input_filesystem_1 = request.equeue(id="in_filesystem_1")
input_filesystem_2 = request.equeue(id="in_filesystem_2") # input_filesystem_2 = request.equeue(id="in_filesystem_2")
input_filesystem_3 = request.equeue(id="in_filesystem_3") # input_filesystem_3 = request.equeue(id="in_filesystem_3")
input_filesystem_4 = request.equeue(id="in_filesystem_4") # input_filesystem_4 = request.equeue(id="in_filesystem_4")
#input_fs = cue_cut(mksafe(request.equeue(id="fs"))) #input_fs = cue_cut(mksafe(request.equeue(id="fs")))
...@@ -57,26 +57,34 @@ input_filesystem_4 = request.equeue(id="in_filesystem_4") ...@@ -57,26 +57,34 @@ input_filesystem_4 = request.equeue(id="in_filesystem_4")
# fun (s) -> begin clear_queue(input_fs) "Done." end) # fun (s) -> begin clear_queue(input_fs) "Done." end)
def clear_items(s) = def clear_items(ns) =
ret = server.execute("fs.primary_queue") ret = server.execute("#{source.id(ns)}.primary_queue")
ret = list.hd(default="", ret) ret = list.hd(default="", ret)
if ret == "" then if ret == "" then
log("Queue cleared.") log("Queue cleared.")
(-1.) (-1.)
else else
log("There are still items in the queue, trying skip ...") log("There are still items in the queue, trying skip ...")
source.skip(s) source.skip(ns)
(0.1) (0.1)
end end
end end
def clear_queue(s) = def clear_queue(ns) =
add_timeout(fast=false, 0.5, {clear_items(s)}) add_timeout(fast=false, 0.5, {clear_items(ns)})
end end
server.register(namespace="fs", # Clear Queue 0
description="Clear all items of the filesystem queue.", server.register(namespace=source.id(input_filesystem_0),
usage="clear", description="Clear all items of the filesystem Queue A.",
"clear", usage="clear",
fun (s) -> begin clear_queue(input_fs) "Done." end) "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.
Please register or to comment