new worker-task crate, move WorkerTaskContext from sys

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-07-11 10:14:28 +02:00
parent f3021e686a
commit 847a57740b
10 changed files with 47 additions and 5 deletions

View File

@ -42,6 +42,7 @@ members = [
"proxmox-time",
"proxmox-time-api",
"proxmox-uuid",
"proxmox-worker-task",
]
exclude = [
"build",
@ -141,3 +142,4 @@ proxmox-sys = { version = "0.5.7", path = "proxmox-sys" }
proxmox-tfa = { version = "5.0.0", path = "proxmox-tfa" }
proxmox-time = { version = "2.0.0", path = "proxmox-time" }
proxmox-uuid = { version = "1.0.1", path = "proxmox-uuid" }
proxmox-worker-task = { version = "1.0.0", path = "proxmox-worker-task" }

View File

@ -46,6 +46,7 @@ proxmox-router.workspace = true
proxmox-schema = { workspace = true, features = [ "api-macro", "upid-api-impl" ] }
proxmox-sys = { workspace = true, features = [ "logrotate", "timer" ] }
proxmox-time.workspace = true
proxmox-worker-task.workspace = true
[features]
default = []

View File

@ -24,9 +24,8 @@ use proxmox_log::{FileLogOptions, FileLogger, LOGGER, WARN_COUNTER};
use proxmox_schema::upid::UPID;
use proxmox_sys::fs::{atomic_open_or_create_file, create_path, replace_file, CreateOptions};
use proxmox_sys::linux::procfs;
use proxmox_sys::logrotate::{LogRotate, LogRotateFiles};
use proxmox_sys::WorkerTaskContext;
use proxmox_worker_task::WorkerTaskContext;
use crate::CommandSocket;

View File

@ -18,9 +18,6 @@ pub mod mmap;
pub mod process_locker;
pub mod systemd;
mod worker_task_context;
pub use worker_task_context::*;
/// Returns the hosts node name (UTS node name)
pub fn nodename() -> &'static str {
lazy_static::lazy_static! {

View File

@ -0,0 +1,13 @@
[package]
name = "proxmox-worker-task"
version = "1.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Worker task functionality"
exclude.workspace = true
[dependencies]
anyhow.workspace = true

View File

@ -0,0 +1,5 @@
rust-proxmox-worker-task (0.1.0-1) bookworm; urgency=medium
* Initial release
-- Proxmox Support Team <support@proxmox.com> Thu, 11 Jul 2024 13:03:45 +0200

View File

View File

@ -0,0 +1,18 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files:
*
Copyright: 2019 - 2024 Proxmox Server Solutions GmbH <support@proxmox.com>
License: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.
.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>.

View File

@ -0,0 +1,7 @@
overlay = "."
crate_src_path = ".."
maintainer = "Proxmox Support Team <support@proxmox.com>"
[source]
vcs_git = "git://git.proxmox.com/git/proxmox.git"
vcs_browser = "https://git.proxmox.com/?p=proxmox.git"