summaryrefslogtreecommitdiff
path: root/server-beta/src/workspace
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/workspace')
-rw-r--r--server-beta/src/workspace/workspace.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/server-beta/src/workspace/workspace.lua b/server-beta/src/workspace/workspace.lua
index efe2f1cf..70334134 100644
--- a/server-beta/src/workspace/workspace.lua
+++ b/server-beta/src/workspace/workspace.lua
@@ -86,6 +86,8 @@ function m.preload()
if not m.uri then
return
end
+ local max = 0
+ local read = 0
log.info('Preload start.')
local ignore = m.getIgnoreMatcher()
@@ -111,22 +113,21 @@ function m.preload()
if not files.isLua(uri) then
return
end
+ max = max + 1
pub.syncTask('loadFile', uri, function (text)
+ read = read + 1
log.info(('Preload file at: %s , size = %.3f KB'):format(uri, #text / 1000.0))
files.setText(uri, text)
end)
end)
+ log.info(('Found %d files.'):format(max))
while true do
- local count = 0
- for _, file in pairs(files.fileMap) do
- if file.compiling then
- task.sleep(0.1)
- goto CONTINUE
- end
- count = count + 1
+ log.info(('Loaded %d/%d files'):format(read, max))
+ if read < max then
+ task.sleep(0.1)
+ goto CONTINUE
end
- log.info(('Preloaded %d files.'):format(count))
break
::CONTINUE::
end