BREAKING CHANGE: Legacy worker files removed, Worker struct simplified Changes: 1. worker.go - Simplified to 8 fields using composed dependencies: - runLoop, runner, metrics, health (from new packages) - Removed: server, queue, running, datasetCache, ctx, cancel, etc. 2. factory.go - Updated NewWorker to use new structure - Uses lifecycle.NewRunLoop - Integrates jupyter.Manager properly 3. Removed legacy files: - execution.go (1,016 lines) - data_integrity.go (929 lines) - runloop.go (555 lines) - jupyter_task.go (144 lines) - simplified.go (demonstration no longer needed) 4. Fixed references to use new packages: - hash_selector.go -> integrity.DirOverallSHA256Hex - snapshot_store.go -> integrity.NormalizeSHA256ChecksumHex - metrics.go - Removed resource-dependent metrics temporarily 5. Added RecordQueueLatency to metrics.Metrics for lifecycle.MetricsRecorder Worker struct: 27 fields -> 8 fields (70% reduction) Build status: Compiles successfully
18 lines
689 B
Go
18 lines
689 B
Go
package worker
|
|
|
|
import "github.com/jfraeys/fetch_ml/internal/worker/integrity"
|
|
|
|
// UseNativeLibs controls whether to use C++ implementations.
|
|
// Set FETCHML_NATIVE_LIBS=1 to enable native libraries.
|
|
// This is defined here so it's available regardless of build tags.
|
|
var UseNativeLibs = false
|
|
|
|
// dirOverallSHA256Hex selects implementation based on toggle.
|
|
// This file has no CGo imports so it compiles even when CGO is disabled.
|
|
// The actual implementations are in native_bridge.go (native) and integrity package (Go).
|
|
func dirOverallSHA256Hex(root string) (string, error) {
|
|
if !UseNativeLibs {
|
|
return integrity.DirOverallSHA256Hex(root)
|
|
}
|
|
return dirOverallSHA256HexNative(root)
|
|
}
|