mirror of
https://github.com/hkalexling/Mango.git
synced 2026-05-01 00:00:55 -04:00
Apply yield forcely
This commit is contained in:
@@ -115,6 +115,7 @@ class Title
|
||||
previous_entries_size = @entries.size
|
||||
@entries.select! do |entry|
|
||||
existence = File.exists? entry.zip_path
|
||||
yield_process_file context
|
||||
context["deleted_entry_ids"] << entry.id unless existence
|
||||
existence
|
||||
end
|
||||
|
||||
@@ -140,3 +140,8 @@ alias ExamineContext = NamedTuple(
|
||||
deleted_title_ids: Array(String),
|
||||
deleted_entry_ids: Array(String)
|
||||
)
|
||||
|
||||
def yield_process_file(context : ExamineContext)
|
||||
context["file_count"] += 1
|
||||
Fiber.yield if context["file_count"] % 1000 == 0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user